diff --git a/docs/conf.py b/docs/conf.py index 9aa914c73..3be2ed98f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,9 +18,9 @@ sys.path.insert(0, os.path.abspath("..")) # -- Project information ----------------------------------------------------- -project = "pyrad" -copyright = "2022, pyrad Team" -author = "pyrad Team" +project = "pyRad" +copyright = "2022, pyRad Team" +author = "pyRad Team" # The full version, including alpha/beta/rc tags release = "0.0.0" @@ -52,3 +52,4 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # a list of builtin themes. # html_theme = "furo" +html_title = "pyRad" diff --git a/docs/field_modules.rst b/docs/field_modules.rst deleted file mode 100644 index 117044fb3..000000000 --- a/docs/field_modules.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. _field_modules: - -============ - -Embeddings ----------------- - -.. automodule:: pyrad.nerf.field_modules.embedding - :members: - :show-inheritance: - -Encodings ----------------- - -.. automodule:: pyrad.nerf.field_modules.encoding - :members: - :show-inheritance: - -Field Heads ----------------- - -.. automodule:: pyrad.nerf.field_modules.field_heads - :members: - :show-inheritance: - -Field Losses ----------------- - -.. automodule:: pyrad.nerf.field_modules.field_losses - :members: - :show-inheritance: - -MLP ----------------- - -.. automodule:: pyrad.nerf.field_modules.mlp - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 4cddb025e..ffe12c227 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,23 +1,20 @@ -.. pyrad documentation master file, created by - sphinx-quickstart on Tue May 31 11:49:30 2022. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Pyrad |:metal:| +pyRad |:metal:| ==================================== Neural Volumetric Rendering ---------------------------------- +.. toctree:: + :caption: Quickstart + + quickstart/installation + quickstart/getting_around .. toctree:: - :maxdepth: 4 - :caption: Contents: + :caption: Reference: - pyrad - quickstart - + reference/index Indices and tables ================== diff --git a/docs/pyrad.rst b/docs/pyrad.rst deleted file mode 100644 index fa3eadd94..000000000 --- a/docs/pyrad.rst +++ /dev/null @@ -1,64 +0,0 @@ -.. _pyrad: - -Reference -============ - -Dataset -------------------------------- - -.. toctree:: - :maxdepth: 2 - - dataset - -Image Samplers -------------------------------- - -.. automodule:: pyrad.nerf.image_sampler - :members: - :show-inheritance: - -Pixel Samplers -------------------------------- - -.. automodule:: pyrad.nerf.pixel_sampler - :members: - :show-inheritance: - -Field Modules -------------------------------- - -.. toctree:: - :maxdepth: 2 - - field_modules - -Fields -------------------------------- - -.. toctree:: - :maxdepth: 2 - - fields - -Graphs -------------------------------- - -.. toctree:: - :maxdepth: 2 - - graphs - -Renderers -------------------------------- - -.. automodule:: pyrad.nerf.renderers - :members: - :show-inheritance: - -Ray Samplers -------------------------------- - -.. automodule:: pyrad.nerf.ray_sampler - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/quickstart.rst b/docs/quickstart/getting_around.rst similarity index 52% rename from docs/quickstart.rst rename to docs/quickstart/getting_around.rst index cae06eed1..e01e21fa1 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart/getting_around.rst @@ -1,69 +1,7 @@ -.. _quickstart: - -Quickstart -============ - -Installation -------------------------------- - -Clone the repo:: - - git clone --recurse-submodules git@github.com:ethanweber/pyrad.git - -Create the python environment:: - - conda create --name pyrad python=3.8.13 - conda activate pyrad - pip install -r environment/requirements.txt - -Install pyrad as a library:: - - pip install -e . - -Install library with CUDA support. Change setup.py to ``USE_CUDA = True`` and then:: - - python setup.py develop - -Running the test cases:: - - pytest tests - Field Modules - - -Getting the data -------------------------------- - -Download the original NeRF dataset and put it in the following format.:: - - - - data/ - - blender/ - - fern/ - - lego/ - -Training a model -------------------------------- - -Run with default config:: - - python scripts/run_train.py - -Run with config changes:: - - python scripts/run_train.py machine_config.num_gpus=1 - python scripts/run_train.py data.dataset.downscale_factor=1 - -Run with different datasets:: - - python scripts/run_train.py data/dataset=blender_lego - python scripts/run_train.py data/dataset=friends_TBBT-big_living_room - -Run with different datasets and config changes:: - - python scripts/run_train.py data/dataset=friends_TBBT-big_living_room graph.network.far_plane=14 +.. _getting_around: Getting around the codebase -------------------------------- +===================================== The entry point for training starts at ``scripts/run_train.py``, which spawns instances of our ``Trainer()`` class (in ``nerf/trainer.py``). The ``Trainer()`` is responsible for setting up the datasets and NeRF graph depending on the config specified. If you are planning on just using our codebase to build a new NeRF method or use an existing implementation, we've abstracted away the training routine in these two files and chances are you will not need to touch them. diff --git a/docs/quickstart/installation.rst b/docs/quickstart/installation.rst new file mode 100644 index 000000000..ea282fff8 --- /dev/null +++ b/docs/quickstart/installation.rst @@ -0,0 +1,59 @@ +.. _installation: + +Installation +================= + +Clone the repo:: + + git clone --recurse-submodules git@github.com:ethanweber/pyrad.git + +Create the python environment:: + + conda create --name pyrad python=3.8.13 + conda activate pyrad + pip install -r environment/requirements.txt + +Install pyrad as a library:: + + pip install -e . + +Install library with CUDA support. Change setup.py to ``USE_CUDA = True`` and then:: + + python setup.py develop + +Running the test cases:: + + pytest tests + Field Modules + +Getting the data +------------------ + +Download the original NeRF dataset and put it in the following format.:: + + + - data/ + - blender/ + - fern/ + - lego/ + +Training a model +------------------ + +Run with default config:: + + python scripts/run_train.py + +Run with config changes:: + + python scripts/run_train.py machine_config.num_gpus=1 + python scripts/run_train.py data.dataset.downscale_factor=1 + +Run with different datasets:: + + python scripts/run_train.py data/dataset=blender_lego + python scripts/run_train.py data/dataset=friends_TBBT-big_living_room + +Run with different datasets and config changes:: + + python scripts/run_train.py data/dataset=friends_TBBT-big_living_room graph.network.far_plane=14 diff --git a/docs/dataset.rst b/docs/reference/dataset.rst similarity index 98% rename from docs/dataset.rst rename to docs/reference/dataset.rst index 5c6957806..e2099728c 100644 --- a/docs/dataset.rst +++ b/docs/reference/dataset.rst @@ -1,5 +1,6 @@ .. _dataset: +Dataset ============ Colmap Utils diff --git a/docs/reference/field_modules/embeddings.rst b/docs/reference/field_modules/embeddings.rst new file mode 100644 index 000000000..4dabbbb2c --- /dev/null +++ b/docs/reference/field_modules/embeddings.rst @@ -0,0 +1,8 @@ +.. _embeddings: + +Embeddings +=================== + +.. automodule:: pyrad.nerf.field_modules.embedding + :members: + :show-inheritance: \ No newline at end of file diff --git a/docs/reference/field_modules/encodings.rst b/docs/reference/field_modules/encodings.rst new file mode 100644 index 000000000..d7a900f6a --- /dev/null +++ b/docs/reference/field_modules/encodings.rst @@ -0,0 +1,8 @@ +.. _encodings: + +Encodings +=================== + +.. automodule:: pyrad.nerf.field_modules.encoding + :members: + :show-inheritance: \ No newline at end of file diff --git a/docs/reference/field_modules/field_heads.rst b/docs/reference/field_modules/field_heads.rst new file mode 100644 index 000000000..a2e9d8247 --- /dev/null +++ b/docs/reference/field_modules/field_heads.rst @@ -0,0 +1,8 @@ +.. _field_heads: + +Field Heads +=================== + +.. automodule:: pyrad.nerf.field_modules.field_heads + :members: + :show-inheritance: \ No newline at end of file diff --git a/docs/reference/field_modules/field_losses.rst b/docs/reference/field_modules/field_losses.rst new file mode 100644 index 000000000..f2aa12430 --- /dev/null +++ b/docs/reference/field_modules/field_losses.rst @@ -0,0 +1,8 @@ +.. _field_losses: + +Field Losses +=================== + +.. automodule:: pyrad.nerf.field_modules.field_losses + :members: + :show-inheritance: \ No newline at end of file diff --git a/docs/reference/field_modules/index.rst b/docs/reference/field_modules/index.rst new file mode 100644 index 000000000..3915476bf --- /dev/null +++ b/docs/reference/field_modules/index.rst @@ -0,0 +1,14 @@ +.. _field_modules: + +Field Modules +=================== + +TODO: High level description of field modules and how they connect together. + +.. toctree:: + + encodings + embeddings + field_heads + field_losses + mlp \ No newline at end of file diff --git a/docs/reference/field_modules/mlp.rst b/docs/reference/field_modules/mlp.rst new file mode 100644 index 000000000..a71fcd7f0 --- /dev/null +++ b/docs/reference/field_modules/mlp.rst @@ -0,0 +1,8 @@ +.. _mlp: + +MLP +=================== + +.. automodule:: pyrad.nerf.field_modules.mlp + :members: + :show-inheritance: \ No newline at end of file diff --git a/docs/fields.rst b/docs/reference/fields.rst similarity index 98% rename from docs/fields.rst rename to docs/reference/fields.rst index 068ed81dd..8990bebd3 100644 --- a/docs/fields.rst +++ b/docs/reference/fields.rst @@ -1,5 +1,6 @@ .. _fields: +Fields ============ Base diff --git a/docs/graphs.rst b/docs/reference/graphs.rst similarity index 98% rename from docs/graphs.rst rename to docs/reference/graphs.rst index b863c6c3d..a2cd06fdc 100644 --- a/docs/graphs.rst +++ b/docs/reference/graphs.rst @@ -1,5 +1,6 @@ .. _graphs: +Graphs ============ Base diff --git a/docs/reference/index.rst b/docs/reference/index.rst new file mode 100644 index 000000000..7b45421be --- /dev/null +++ b/docs/reference/index.rst @@ -0,0 +1,34 @@ +.. _reference: + +API +============ + +TODO: Explanation of each component + +.. toctree:: + :hidden: + + dataset + samplers + field_modules/index + renderers + fields + graphs + +Hydra config structure +======================== + +Logging, debugging utilities +=================================== + +Benchmarking, other tooling +=================================== + +Running other repos with our data +=================================== + +Speeding up the code +=================================== + +Setting up Jupyter +======================== \ No newline at end of file diff --git a/docs/reference/renderers.rst b/docs/reference/renderers.rst new file mode 100644 index 000000000..a18d6f437 --- /dev/null +++ b/docs/reference/renderers.rst @@ -0,0 +1,8 @@ +.. _renderers: + +Renderers +============ + +.. automodule:: pyrad.nerf.renderers + :members: + :show-inheritance: diff --git a/docs/reference/samplers.rst b/docs/reference/samplers.rst new file mode 100644 index 000000000..62cc35476 --- /dev/null +++ b/docs/reference/samplers.rst @@ -0,0 +1,25 @@ +.. _samplers: + +Samplers +============ + +Image Samplers +------------------------------- + +.. automodule:: pyrad.nerf.image_sampler + :members: + :show-inheritance: + +Pixel Samplers +------------------------------- + +.. automodule:: pyrad.nerf.pixel_sampler + :members: + :show-inheritance: + +Ray Samplers +------------------------------- + +.. automodule:: pyrad.nerf.ray_sampler + :members: + :show-inheritance: \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 681101a61..7239194ae 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ +furo==2022.4.7 readthedocs-sphinx-search==0.1.2 sphinx==4.5.0 -furo==2022.4.7 sphinxemoji==0.2.0 \ No newline at end of file