mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-16 21:03:46 +08:00
Update docs.
This commit is contained in:
1 parent
bed39763a1
commit
35deb34515
17 files changed
+86
-26
No files matched your search
@@ -40,6 +40,7 @@ extensions = [
|
||||
"sphinxemoji.sphinxemoji",
|
||||
"myst_parser",
|
||||
"sphinx.ext.napoleon",
|
||||
"sphinx_copybutton",
|
||||
]
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
@@ -57,6 +58,12 @@ suppress_warnings = ["myst.header"]
|
||||
html_theme = "furo"
|
||||
html_title = "pyRad"
|
||||
|
||||
autosectionlabel_prefix_document = True
|
||||
|
||||
# -- Code block theme --------------------------------------------------------
|
||||
|
||||
pygments_style = "manni"
|
||||
pygments_dark_style = "stata-dark"
|
||||
|
||||
# -- Napoleon settings -------------------------------------------------------
|
||||
|
||||
|
||||
@@ -22,4 +22,4 @@ NeRF
|
||||
|
||||
.. automodule:: pyrad.fields.nerf_field
|
||||
:members:
|
||||
:show-inheritance:
|
||||
:show-inheritance:
|
||||
@@ -6,12 +6,13 @@ API
|
||||
TODO: Explanation of each component
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
dataset
|
||||
fields
|
||||
fields/modules/index
|
||||
graphs
|
||||
graphs/modules/index
|
||||
optimizers
|
||||
renderers/index
|
||||
|
||||
utils/index
|
||||
viewer
|
||||
@@ -0,0 +1,9 @@
|
||||
.. _optimizers:
|
||||
|
||||
Optimizers
|
||||
============
|
||||
|
||||
.. automodule:: pyrad.optimizers.optimizers
|
||||
:members:
|
||||
:show-inheritance:
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
.. _colors:
|
||||
|
||||
Colors
|
||||
------------
|
||||
|
||||
.. automodule:: pyrad.utils.colors
|
||||
:members:
|
||||
:show-inheritance:
|
||||
@@ -0,0 +1,10 @@
|
||||
.. _utils:
|
||||
|
||||
Utils
|
||||
===================
|
||||
|
||||
.. toctree::
|
||||
|
||||
colors
|
||||
math
|
||||
visualization
|
||||
@@ -0,0 +1,8 @@
|
||||
.. _math:
|
||||
|
||||
Math
|
||||
============
|
||||
|
||||
.. automodule:: pyrad.utils.math
|
||||
:members:
|
||||
:show-inheritance:
|
||||
@@ -0,0 +1,8 @@
|
||||
.. _visualization:
|
||||
|
||||
Visualization
|
||||
----------------
|
||||
|
||||
.. automodule:: pyrad.utils.visualization
|
||||
:members:
|
||||
:show-inheritance:
|
||||
@@ -0,0 +1,8 @@
|
||||
.. _viewer:
|
||||
|
||||
Viewer
|
||||
============
|
||||
|
||||
.. automodule:: pyrad.viewer
|
||||
:members:
|
||||
:show-inheritance:
|
||||
@@ -1,5 +1,6 @@
|
||||
furo==2022.4.7
|
||||
readthedocs-sphinx-search==0.1.2
|
||||
myst-parser==0.17.2
|
||||
sphinx==4.5.0
|
||||
sphinxemoji==0.2.0
|
||||
myst-parser==0.17.2
|
||||
sphinx-copybutton==0.5.0
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
We make it easy to benchmark your new NeRF against the standard Blender dataset.
|
||||
|
||||
#### Launching training on Blender
|
||||
#### Launching training on Blender dataset
|
||||
|
||||
To start, you will need to train your NeRF on each of the blender objects.
|
||||
To launch training jobs automatically on each of these items, you can call:
|
||||
|
||||
```
|
||||
```bash
|
||||
./scripts/benchmarking/launch_train_blender.sh <config-name> <list_of_gpus>
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ Simply replace the arguments in brackets with the correct arguments.
|
||||
|
||||
A full example would be:
|
||||
|
||||
```
|
||||
```bash
|
||||
./scripts/benchmarking/launch_train_blender.sh graph_vanilla_nerf 0 1 2 3
|
||||
```
|
||||
|
||||
@@ -29,7 +29,7 @@ Once you have launched training, and training converges, you can test your metho
|
||||
|
||||
Modify the `BENCH` variable to specify which jobs you want benchmarked.
|
||||
|
||||
```
|
||||
```python
|
||||
BENCH = {
|
||||
"method": "graph_vanilla_nerf", # change this to whatever you want
|
||||
"hydra_base_dir": "outputs/", # change this to wherever hydra's default output directory is
|
||||
@@ -40,7 +40,7 @@ BENCH = {
|
||||
|
||||
Then you can simply run
|
||||
|
||||
```
|
||||
```bash
|
||||
python scripts/benchmarking/run_benchmark.py
|
||||
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ We provide a few visualization tools with Jupyter that can be found in `notebook
|
||||
|
||||
To install and run any of the notebooks, simply run the following commands:
|
||||
|
||||
```
|
||||
```bash
|
||||
python -m jupyter lab build
|
||||
bash environments/run_jupyter.sh
|
||||
```
|
||||
@@ -3,7 +3,7 @@
|
||||
We provide integration with multiple logging interfaces to log images and statistics during training.
|
||||
All of these loggers are configurable via the config:
|
||||
|
||||
```
|
||||
```yaml
|
||||
# e.g. configs/graphs_default.yaml
|
||||
|
||||
logging:
|
||||
|
||||
@@ -4,7 +4,7 @@ If you are looking to test out other existing repo's with our data, the pyRad st
|
||||
|
||||
For instance, you can run nerf-pytorch and jaxnerf with the following commands:
|
||||
|
||||
```
|
||||
```bash
|
||||
# nerf-pytorch
|
||||
cd external
|
||||
python run_nerf.py --config configs/chair.txt --datadir /path/to/pyrad/data/blender/chair
|
||||
|
||||
@@ -6,7 +6,7 @@ We provide built-in performance profiling capabilities to make it easier for you
|
||||
#### In-house profiler
|
||||
You can use our built-in profiler by enabling the profiler in the config:
|
||||
|
||||
```
|
||||
```yaml
|
||||
# e.g. configs/graphs_default.yaml
|
||||
|
||||
logging:
|
||||
@@ -17,7 +17,7 @@ The profiler computes the average total time of execution for any function with
|
||||
For instance, if you wanted to profile the total time it takes to generate rays given pixel and camera indices via the `RayGenerator` class, you would want to evaluate its `forward()` function. In that class, you would need to add the decorator to the function.
|
||||
|
||||
|
||||
```
|
||||
```python
|
||||
class RayGenerator(nn.Module):
|
||||
|
||||
...
|
||||
@@ -38,13 +38,13 @@ If you want to profile the entire codebase, we provide functionality to generate
|
||||
|
||||
Install PySpy
|
||||
|
||||
```
|
||||
```bash
|
||||
pip install py-spy
|
||||
```
|
||||
|
||||
To perform the profiling, you can either specify that you want to generate a flame graph or generate a live-view of the profiler.
|
||||
|
||||
```
|
||||
```bash
|
||||
## for flame graph
|
||||
|
||||
./scripts/debugging/profile.sh -t flame -o flame.svg -p <python_command>
|
||||
@@ -56,7 +56,7 @@ To perform the profiling, you can either specify that you want to generate a fla
|
||||
|
||||
In both cases, `<python_command>` can be replaced with any command you would normally run in the terminal. For instance, you can replace `<python_function>` with `scripts/run_train.py data/dataset=blender_lego`. Then the full command would be e.g.:
|
||||
|
||||
```
|
||||
```bash
|
||||
./scripts/debugging/profile.sh -t flame -o flame.svg -p scripts/run_train.py data/dataset=blender_lego
|
||||
```
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
Documentation for running the code with CUDA.
|
||||
Please see https://github.com/NVlabs/tiny-cuda-nn for how to install tiny-cuda-nn.
|
||||
|
||||
```
|
||||
```bash
|
||||
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
|
||||
```
|
||||
|
||||
To run instant-ngp with tcnn, you can do the following. This is with the fox dataset.
|
||||
|
||||
```
|
||||
```bash
|
||||
python scripts/run_train.py --config-name=instant_ngp_tcnn.yaml data/dataset=instant_ngp_fox
|
||||
```
|
||||
@@ -11,22 +11,22 @@ If you are looking to implemnet a new NeRF method or extend an existing one, you
|
||||
All NeRF graph definitions can be found in `graphs/`. The graph encapsulates all the modules in the NeRF method- from the MLP's to the samplers to the losses and optimizers. All graphs are composed of modules and fields.
|
||||
|
||||
### Modules
|
||||
We can decompose all graphs into respective modules. For instance, we have `optimizers/` which contains modules related to the loss, `renderers/` which contains all rendering modules, `graph/modules/`, which includes samplers and ray generators. Additionally, we have `fields/modules`, which will be discussed below.
|
||||
We can decompose all graphs into respective modules. For instance, we have {ref}`optimizers` which contains modules related to the loss, {ref}`renderers` which contains all rendering modules, {`graph/modules/`}, which includes samplers and ray generators. Additionally, we have {ref}`field_modules`, which will be discussed below.
|
||||
In general, modules can be thought of as individual component parts of the graph that can be swapped in/out. We provide most of the standard modules, but if you are creating a new NeRF graph, you may have to define new modules.
|
||||
|
||||
|
||||
### Fields
|
||||
|
||||
Fields (`fields/`) represents the "space", aka. the radiance field of the NeRF. Here, we define the field as the part of the network that takes in point samples and any other conditioning, and outputs any of the `FieldHeadNames` (`nerf/field_modules/field_heads.py`).
|
||||
{ref}`fields` represents the "space", aka. the radiance field of the NeRF. Here, we define the field as the part of the network that takes in point samples and any other conditioning, and outputs any of the `FieldHeadNames` (`nerf/field_modules/field_heads.py`).
|
||||
|
||||
All fields are composed of modules continained within the `fields/` directory (e.g. `fields/modules/` or `fields/occupancy_fields/`). We can think of field modules as modules that actually define or interact with the field.
|
||||
|
||||
To build a NeRF field, we therefore follow these steps:
|
||||
1. define any relevant field modules
|
||||
2. create a new class that extends the `Field` class and use these field modules to compose the full field
|
||||
2. create a new class that extends the {ref}`fields` base class and use these field modules to compose the full field
|
||||
3. implement the abstract functions `get_density()` and `get_outputs()`.
|
||||
|
||||
```
|
||||
```python
|
||||
class NeRFField(Field):
|
||||
"""NeRF Field"""
|
||||
|
||||
@@ -67,7 +67,7 @@ Now that we've gone over what modules and fields are, we are ready to create the
|
||||
To implement the vanilla NeRF, we create a new class that inherits the abstract Graph class. Similar to composing a new field, we can pull from all pre-defined fields and modules and use them to compose a new Graph.
|
||||
We will then need to define the following abstract methods as seen in the skeleton code below. See also `graphs/vanilla_nerf.py` for the full implementation.
|
||||
|
||||
```
|
||||
```python
|
||||
class NeRFGraph(Graph):
|
||||
"""Vanilla NeRF graph"""
|
||||
|
||||
@@ -111,7 +111,7 @@ class NeRFGraph(Graph):
|
||||
Now that you have the graph and dataset all set up, you'll need to create the config that you pass into our run train routine. Our config system is powered by [Hydra](https://hydra.cc/). All Hydra and machine related arguments are stored in `configs/default_setup.yaml`, as well as the defaults list.
|
||||
To set up the graph config, create a new yaml under `configs/`.
|
||||
|
||||
```
|
||||
```yaml
|
||||
# configs/vanilla_nerf.yaml
|
||||
|
||||
defaults:
|
||||
@@ -135,7 +135,7 @@ data:
|
||||
|
||||
Once you have the config properly set up, you can begin training! To begin the training process, just pass in the name of your new config to the training script:
|
||||
|
||||
```
|
||||
```bash
|
||||
python scripts/run_train.py --config-name vanilla_nerf
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user