From 7edd7682406a03f94e20e18af6534887ca473a1e Mon Sep 17 00:00:00 2001 From: hturki Date: Tue, 9 Jan 2024 19:58:02 -0500 Subject: [PATCH] Add PyNeRF external method (#2734) * add pynerf method * fixes * fixes * format * rename k-planes references --- docs/index.md | 1 + docs/nerfology/methods/index.md | 1 + docs/nerfology/methods/pynerf.md | 92 ++++++++++++++++++++++++++ nerfstudio/configs/external_methods.py | 23 +++++++ 4 files changed, 117 insertions(+) create mode 100644 docs/nerfology/methods/pynerf.md diff --git a/docs/index.md b/docs/index.md index bc3a9ef1b..9e6ac0fac 100644 --- a/docs/index.md +++ b/docs/index.md @@ -152,6 +152,7 @@ This documentation is organized into 3 parts: - [NeRFPlayer](nerfology/methods/nerfplayer.md): 4D Radiance Fields by Streaming Feature Channels - [Tetra-NeRF](nerfology/methods/tetranerf.md): Representing Neural Radiance Fields Using Tetrahedra - [Instruct-GS2GS](nerfology/methods/igs2gs.md): Editing 3DGS Scenes with Instructions +- [PyNeRF](nerfology/methods/pynerf.md): Pyramidal Neural Radiance Fields **Eager to contribute a method?** We'd love to see you use nerfstudio in implementing new (or even existing) methods! Please view our {ref}`guide` for more details about how to add to this list! diff --git a/docs/nerfology/methods/index.md b/docs/nerfology/methods/index.md index 0cc68432d..980fa5335 100644 --- a/docs/nerfology/methods/index.md +++ b/docs/nerfology/methods/index.md @@ -39,6 +39,7 @@ The following methods are supported in nerfstudio: TensoRF Generfacto Instruct-GS2GS + PyNeRF ``` (own_method_docs)= diff --git a/docs/nerfology/methods/pynerf.md b/docs/nerfology/methods/pynerf.md new file mode 100644 index 000000000..31704b6dd --- /dev/null +++ b/docs/nerfology/methods/pynerf.md @@ -0,0 +1,92 @@ +# PyNeRF + +

Pyramidal Neural Radiance Fields

+ + +```{button-link} https://haithemturki.com/pynerf/ +:color: primary +:outline: +Paper Website +``` + +```{button-link} https://github.com/hturki/pynerf +:color: primary +:outline: +Code +``` + + + +**A fast NeRF anti-aliasing strategy.** + + +## Installation + +First, install Nerfstudio and its dependencies. Then install the PyNeRF extension and [torch-scatter](https://github.com/rusty1s/pytorch_scatter): +``` +pip install git+https://github.com/hturki/pynerf +pip install torch-scatter -f https://data.pyg.org/whl/torch-${TORCH_VERSION}+${CUDA}.html +``` + +## Running PyNeRF + +There are three default configurations provided which use the MipNeRF 360 and Multicam dataparsers by default. You can easily use other dataparsers via the ``ns-train`` command (ie: ``ns-train pynerf nerfstudio-data --data `` to use the Nerfstudio data parser) + +The default configurations provided are: + +| Method | Description | Scene type | Memory | +| ----------------------- |---------------------------------------------------| ------------------------------ |--------| +| `pynerf ` | Tuned for outdoor scenes, uses proposal network | outdoors | ~5GB | +| `pynerf-synthetic` | Tuned for synthetic scenes, uses proposal network | synthetic | ~5GB | +| `pynerf-occupancy-grid` | Tuned for Multiscale blender, uses occupancy grid | synthetic | ~5GB | + + +The main differences between them is whether they are suited for synthetic/indoor or real-world unbounded scenes (in case case appearance embeddings and scene contraction are enabled), and whether sampling is done with a proposal network (usually better for real-world scenes) or an occupancy grid (usally better for single-object synthetic scenes like Blender). + +## Method + +Most NeRF methods assume that training and test-time cameras capture scene content from a roughly constant distance: + + + + + + + + + +
+
+ +
+
+ +
+ +They degrade and render blurry views in less constrained settings: + + + + + + + + + +
+
+ +
+
+ +
+ +This is due to NeRF being scale-unaware, as it reasons about point samples instead of volumes. We address this by training a pyramid of NeRFs that divide the scene at different resolutions. We use "coarse" NeRFs for far-away samples, and finer NeRF for close-up samples: + + \ No newline at end of file diff --git a/nerfstudio/configs/external_methods.py b/nerfstudio/configs/external_methods.py index 72a679066..d530cf5bc 100644 --- a/nerfstudio/configs/external_methods.py +++ b/nerfstudio/configs/external_methods.py @@ -152,6 +152,29 @@ To enable Instruct-GS2GS, you must install it first by running: ) ) +# PyNeRF +external_methods.append( + ExternalMethod( + """[bold yellow]PyNeRF[/bold yellow] +For more information visit https://docs.nerf.studio/nerfology/methods/pynerf.html + +To enable PyNeRF, you must install it first by running: + [grey]pip install git+https://github.com/hturki/pynerf[/grey]""", + configurations=[ + ("pynerf", "PyNeRF with proposal network. The default parameters are suited for outdoor scenes."), + ( + "pynerf-synthetic", + "PyNeRF with proposal network. The default parameters are suited for synthetic scenes.", + ), + ( + "pynerf-occupancy-grid", + "PyNeRF with occupancy grid. The default parameters are suited for synthetic scenes.", + ), + ], + pip_package="git+https://github.com/hturki/pynerf", + ) +) + @dataclass class ExternalMethodTrainerConfig(TrainerConfig):