Download codes/reconstruction/transientnerf/loaders/utils.py from shuinb/SP-TransientBench: direct link, hf CLI and curl.
- Browser
- Download file 312 Bytes
-
https://huggingface.co/datasets/shuinb/SP-TransientBench/resolve/main/codes/reconstruction/transientnerf/loaders/utils.py
- Command line
-
hf download hf://datasets/shuinb/SP-TransientBench/codes/reconstruction/transientnerf/loaders/utils.py
-
curl -L -o utils.py https://huggingface.co/datasets/shuinb/SP-TransientBench/resolve/main/codes/reconstruction/transientnerf/loaders/utils.py
312 Bytes
| """ | |
| Copyright (c) 2022 Ruilong Li, UC Berkeley. | |
| """ | |
| import collections | |
| Rays = collections.namedtuple("Rays", ("origins", "viewdirs")) | |
| def namedtuple_map(fn, tup): | |
| """Apply `fn` to each element of `tup` and cast to `tup`'s namedtuple.""" | |
| return type(tup)(*(None if x is None else fn(x) for x in tup)) | |