From 06958796735237b309f6b811295edc12b79de901 Mon Sep 17 00:00:00 2001 From: Ethan Weber Date: Tue, 4 Oct 2022 11:53:16 -0700 Subject: [PATCH] [docs] model to method naming (#652) * renamed model to methods * name change --- docs/developer_guides/config.md | 63 ++++++++++-------- docs/developer_guides/pipelines/index.rst | 12 ++-- docs/developer_guides/pipelines/models.md | 2 +- docs/index.md | 9 ++- .../incrementally_add_cameras.ipynb | 45 ------------- docs/nerfology/dataloader_components/index.md | 9 --- .../pixel_sampling_strategies.ipynb | 37 ---------- .../mipnerf/models_mipnerf_field-dark.png | Bin .../mipnerf/models_mipnerf_field-light.png | Bin .../mipnerf/models_mipnerf_pipeline-dark.png | Bin .../mipnerf/models_mipnerf_pipeline-light.png | Bin .../imgs/models_nerf-field-dark.png | Bin .../imgs/models_nerf-field-light.png | Bin .../imgs/models_nerf-pipeline-dark.png | Bin .../imgs/models_nerf-pipeline-field-dark.png | Bin .../imgs/models_nerf-pipeline-field-light.png | Bin .../imgs/models_nerf-pipeline-light.png | Bin .../models_nerf-pipeline-renderer-dark.png | Bin .../models_nerf-pipeline-renderer-light.png | Bin .../models_nerf-pipeline-sampler-dark.png | Bin .../models_nerf-pipeline-sampler-light.png | Bin docs/nerfology/methods/index.md | 30 +++++++++ .../{models => methods}/instant_ngp.md | 0 docs/nerfology/{models => methods}/mipnerf.md | 0 docs/nerfology/{models => methods}/nerf.md | 0 docs/nerfology/methods/nerfacto.md | 25 +++++++ .../{models => methods}/semantic_nerfw.md | 0 docs/nerfology/models/index.md | 30 --------- docs/nerfology/models/mipnerf_360.md | 15 ----- .../{model_configs.py => method_configs.py} | 18 ++--- scripts/train.py | 2 +- tests/test_train.py | 6 +- 32 files changed, 113 insertions(+), 190 deletions(-) delete mode 100644 docs/nerfology/dataloader_components/incrementally_add_cameras.ipynb delete mode 100644 docs/nerfology/dataloader_components/index.md delete mode 100644 docs/nerfology/dataloader_components/pixel_sampling_strategies.ipynb rename docs/nerfology/{models => methods}/imgs/mipnerf/models_mipnerf_field-dark.png (100%) rename docs/nerfology/{models => methods}/imgs/mipnerf/models_mipnerf_field-light.png (100%) rename docs/nerfology/{models => methods}/imgs/mipnerf/models_mipnerf_pipeline-dark.png (100%) rename docs/nerfology/{models => methods}/imgs/mipnerf/models_mipnerf_pipeline-light.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-field-dark.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-field-light.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-pipeline-dark.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-pipeline-field-dark.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-pipeline-field-light.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-pipeline-light.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-pipeline-renderer-dark.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-pipeline-renderer-light.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-pipeline-sampler-dark.png (100%) rename docs/nerfology/{models => methods}/imgs/models_nerf-pipeline-sampler-light.png (100%) create mode 100644 docs/nerfology/methods/index.md rename docs/nerfology/{models => methods}/instant_ngp.md (100%) rename docs/nerfology/{models => methods}/mipnerf.md (100%) rename docs/nerfology/{models => methods}/nerf.md (100%) create mode 100644 docs/nerfology/methods/nerfacto.md rename docs/nerfology/{models => methods}/semantic_nerfw.md (100%) delete mode 100644 docs/nerfology/models/index.md delete mode 100644 docs/nerfology/models/mipnerf_360.md rename nerfstudio/configs/{model_configs.py => method_configs.py} (95%) diff --git a/docs/developer_guides/config.md b/docs/developer_guides/config.md index 433cb5e5f..710f942bf 100644 --- a/docs/developer_guides/config.md +++ b/docs/developer_guides/config.md @@ -5,7 +5,7 @@ and modify all parameters from a typed CLI supported by [dcargs](https://pypi.or ### Base components -All basic, reusable config components can be found in `nerfstudio/configs/base_config.py`. The `Config` class at the bottom of the file is the upper-most config level and stores all of the sub-configs needed to get started with training. +All basic, reusable config components can be found in `nerfstudio/configs/base_config.py`. The `Config` class at the bottom of the file is the upper-most config level and stores all of the sub-configs needed to get started with training. You can browse this file and read the attribute annotations to see what configs are available and what each specifies. @@ -19,7 +19,7 @@ Let's say you want to create a new model called Nerfacto. You can create a new ` :class: info You can then enable type/auto complete on the config passed into the `NerfactoModel` by specifying the config type below the class definition. - ::: +::: ```python """nerfstudio/models/nerfacto.py""" @@ -48,18 +48,18 @@ The same logic applies to all other custom configs you want to create. For more :class: seealso For how to create the actual data and model classes that follow the configs, please refer to [pipeline overview](pipelines/index.rst). - ::: +::: -### Updating model configs +### Updating method configs -If you are interested in creating a new model config, you will have to modify the `nerfstudio/configs/model_configs.py` file. This is where all of the configs for implemented models are housed. You can browse this file to see how we construct various existing models by modifying the `Config` class and specifying new or modified default components. +If you are interested in creating a new model config, you will have to modify the `nerfstudio/configs/method_configs.py` file. This is where all of the configs for implemented models are housed. You can browse this file to see how we construct various existing models by modifying the `Config` class and specifying new or modified default components. For instance, say we created a brand new model called Nerfacto that has an associated `NerfactoModelConfig`, we can specify the following new Config by overriding the pipeline and optimizers attributes appropriately. ```python -"""nerfstudio/configs/model_configs.py""" +"""nerfstudio/configs/method_configs.py""" -model_configs["nerfacto"] = Config( +method_configs["nerfacto"] = Config( method_name="nerfacto", pipeline=VanillaPipelineConfig( model=NerfactoModelConfig(eval_num_rays_per_chunk=1 << 14), @@ -77,39 +77,44 @@ model_configs["nerfacto"] = Config( ) ``` -After placing your new `Config` class into the `model_configs` dictionary, you can provide a description for the model by updating the `descriptions` dictionary at the top of the file. - +After placing your new `Config` class into the `method_configs` dictionary, you can provide a description for the model by updating the `descriptions` dictionary at the top of the file. ### Modifying from CLI + Often times, you just want to play with the parameters of an existing model without having to specify a new one. You can easily do so via CLI. Below, we showcase some useful CLI commands. - List out all existing models - ```bash - ns-train --help - ``` -- List out all exist configurable parameters for `{MODEL_NAME}` - ```bash - ns-train {MODEL_NAME} --help - ``` + ```bash + ns-train --help + ``` + +- List out all exist configurable parameters for `{METHOD_NAME}` + + ```bash + ns-train {METHOD_NAME} --help + ``` - Change the train/eval dataset - ```bash - ns-train {MODEL_NAME} --data DATA_PATH - ``` + + ```bash + ns-train {METHOD_NAME} --data DATA_PATH + ``` - Enable the viewer - ```bash - ns-train {MODEL_NAME} --vis viewer - ``` + + ```bash + ns-train {METHOD_NAME} --vis viewer + ``` - See what options are available for the specified dataparser (e.g. blender-data) - ```bash - ns-train {MODEL_NAME} {DATA_PARSER} --help - ``` + + ```bash + ns-train {METHOD_NAME} {DATA_PARSER} --help + ``` - Run with changed dataparser attributes and viewer on - ```bash - # NOTE: the dataparser and associated configurations go at the end of the command - ns-train {MODEL_NAME} --vis viewer {DATA_PARSER} --scale-factor 0.5 - ``` + ```bash + # NOTE: the dataparser and associated configurations go at the end of the command + ns-train {METHOD_NAME} --vis viewer {DATA_PARSER} --scale-factor 0.5 + ``` diff --git a/docs/developer_guides/pipelines/index.rst b/docs/developer_guides/pipelines/index.rst index 95d0fa0c4..4be2cdb95 100644 --- a/docs/developer_guides/pipelines/index.rst +++ b/docs/developer_guides/pipelines/index.rst @@ -34,11 +34,11 @@ In the following sections, we describe the Pipeline components and look at their .. toctree:: :maxdepth: 1 - dataparsers.md - datamanagers.md - models.md - fields.md - pipelines.md + dataparsers + datamanagers + models + fields + pipelines Implementing NeRF Papers @@ -47,4 +47,4 @@ Let's say you want to create a custom Pipeline that has a custom DataManager and .. toctree:: :maxdepth: 1 - creating_new_methods.ipynb \ No newline at end of file + creating_new_methods \ No newline at end of file diff --git a/docs/developer_guides/pipelines/models.md b/docs/developer_guides/pipelines/models.md index 57da37697..8afa76d3a 100644 --- a/docs/developer_guides/pipelines/models.md +++ b/docs/developer_guides/pipelines/models.md @@ -14,7 +14,7 @@ ## What is a Model? -A Model is probably what you think of when you think of a NeRF paper. Often the phrases "Model" and "Method" are used interchangeably and for this reason, our [implemented models](/nerfology/models/index) are actually methods. However, most of the implementations details of a method happen in the model code, as you'll see in this section. +A Model is probably what you think of when you think of a NeRF paper. Often the phrases "Model" and "Method" are used interchangeably and for this reason, our implemented [Methods](/nerfology/methods/index) typically only change the model code. A model, at a high level, takes in regions of space described by RayBundle objects, samples points along these rays, and returns rendered values for each ray. So, let's take a look at what it takes to create your own model! diff --git a/docs/index.md b/docs/index.md index 7d5a36f38..3611cafbd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -48,9 +48,8 @@ Contributing :hidden: :caption: NeRFology -nerfology/models/index +nerfology/methods/index nerfology/model_components/index -nerfology/dataloader_components/index ``` ```{toctree} @@ -78,9 +77,9 @@ This documentation is organized into 3 parts: - **🤓 Developer Guides**: describes all of the components and additional support we provide to help you construct, train, and debug your NeRFs. Learn how to set up a model pipeline, use the viewer, create a custom config, and more. - **📚 Reference**: describes each class and function. Develop a better understanding of the core of our technology and terminology. This section includes descriptions of each module and component in the codebase. -## Supported Models +## Supported Methods -- **Nerfacto**: our defacto NeRF model combines modules focused on quality with modules focused on faster rendering. Nerfstudio easily lets us experiment with the best of both worlds! +- [**Nerfacto**](https://github.com/nerfstudio-project/nerfstudio/blob/master/nerfstudio/models/nerfacto.py): our defacto NeRF method combines modules focused on quality with modules focused on faster rendering. Nerfstudio easily lets us experiment with the best of both worlds! - [NeRF](https://www.matthewtancik.com/nerf): Representing Scenes as Neural Radiance Fields for View Synthesis - [Instant NGP](https://nvlabs.github.io/instant-ngp/): Instant Neural Graphics Primitives with a Multiresolution Hash Encoding - [Mipnerf-360](https://jonbarron.info/mipnerf360/): Unbounded Anti-Aliased Neural Radiance Fields @@ -91,7 +90,7 @@ This documentation is organized into 3 parts: We'll be constantly growing this list! So make sure to check back in to see our updates. -**Eager to contribute?** We'd love to see you use nerfstudio in implementing new (or even existing) models! Feel free to contact us directly or view our [Contributor's Guide](reference/contributing) to see how you can get your model on this list! +**Eager to contribute?** We'd love to see you use nerfstudio in implementing new (or even existing) methods! Feel free to contact us directly or view our [Contributor's Guide](reference/contributing) to see how you can get your model on this list! ## Quicklinks diff --git a/docs/nerfology/dataloader_components/incrementally_add_cameras.ipynb b/docs/nerfology/dataloader_components/incrementally_add_cameras.ipynb deleted file mode 100644 index 723669915..000000000 --- a/docs/nerfology/dataloader_components/incrementally_add_cameras.ipynb +++ /dev/null @@ -1,45 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Incrementally Add Cameras" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.8.13 ('nerfactory')", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.13" - }, - "orig_nbformat": 4, - "vscode": { - "interpreter": { - "hash": "e691f033e0f2f1b9c0a11e7e81375a1e27aec87a71fd1b1eaa545f7a5e61b3f6" - } - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/nerfology/dataloader_components/index.md b/docs/nerfology/dataloader_components/index.md deleted file mode 100644 index 2a1dd2ccf..000000000 --- a/docs/nerfology/dataloader_components/index.md +++ /dev/null @@ -1,9 +0,0 @@ -# Dataloader Components - -Here we show how flexible our Dataloader can be with a series of dataloading guides. - -```{toctree} - :maxdepth: 1 - Pixel Sampling Stategies - Incrementally Add Cameras -``` diff --git a/docs/nerfology/dataloader_components/pixel_sampling_strategies.ipynb b/docs/nerfology/dataloader_components/pixel_sampling_strategies.ipynb deleted file mode 100644 index 81fd5e01f..000000000 --- a/docs/nerfology/dataloader_components/pixel_sampling_strategies.ipynb +++ /dev/null @@ -1,37 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Pixel Sampling Strategies" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.8.13 ('nerfactory')", - "language": "python", - "name": "python3" - }, - "language_info": { - "name": "python", - "version": "3.8.13" - }, - "orig_nbformat": 4, - "vscode": { - "interpreter": { - "hash": "e691f033e0f2f1b9c0a11e7e81375a1e27aec87a71fd1b1eaa545f7a5e61b3f6" - } - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/nerfology/models/imgs/mipnerf/models_mipnerf_field-dark.png b/docs/nerfology/methods/imgs/mipnerf/models_mipnerf_field-dark.png similarity index 100% rename from docs/nerfology/models/imgs/mipnerf/models_mipnerf_field-dark.png rename to docs/nerfology/methods/imgs/mipnerf/models_mipnerf_field-dark.png diff --git a/docs/nerfology/models/imgs/mipnerf/models_mipnerf_field-light.png b/docs/nerfology/methods/imgs/mipnerf/models_mipnerf_field-light.png similarity index 100% rename from docs/nerfology/models/imgs/mipnerf/models_mipnerf_field-light.png rename to docs/nerfology/methods/imgs/mipnerf/models_mipnerf_field-light.png diff --git a/docs/nerfology/models/imgs/mipnerf/models_mipnerf_pipeline-dark.png b/docs/nerfology/methods/imgs/mipnerf/models_mipnerf_pipeline-dark.png similarity index 100% rename from docs/nerfology/models/imgs/mipnerf/models_mipnerf_pipeline-dark.png rename to docs/nerfology/methods/imgs/mipnerf/models_mipnerf_pipeline-dark.png diff --git a/docs/nerfology/models/imgs/mipnerf/models_mipnerf_pipeline-light.png b/docs/nerfology/methods/imgs/mipnerf/models_mipnerf_pipeline-light.png similarity index 100% rename from docs/nerfology/models/imgs/mipnerf/models_mipnerf_pipeline-light.png rename to docs/nerfology/methods/imgs/mipnerf/models_mipnerf_pipeline-light.png diff --git a/docs/nerfology/models/imgs/models_nerf-field-dark.png b/docs/nerfology/methods/imgs/models_nerf-field-dark.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-field-dark.png rename to docs/nerfology/methods/imgs/models_nerf-field-dark.png diff --git a/docs/nerfology/models/imgs/models_nerf-field-light.png b/docs/nerfology/methods/imgs/models_nerf-field-light.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-field-light.png rename to docs/nerfology/methods/imgs/models_nerf-field-light.png diff --git a/docs/nerfology/models/imgs/models_nerf-pipeline-dark.png b/docs/nerfology/methods/imgs/models_nerf-pipeline-dark.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-pipeline-dark.png rename to docs/nerfology/methods/imgs/models_nerf-pipeline-dark.png diff --git a/docs/nerfology/models/imgs/models_nerf-pipeline-field-dark.png b/docs/nerfology/methods/imgs/models_nerf-pipeline-field-dark.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-pipeline-field-dark.png rename to docs/nerfology/methods/imgs/models_nerf-pipeline-field-dark.png diff --git a/docs/nerfology/models/imgs/models_nerf-pipeline-field-light.png b/docs/nerfology/methods/imgs/models_nerf-pipeline-field-light.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-pipeline-field-light.png rename to docs/nerfology/methods/imgs/models_nerf-pipeline-field-light.png diff --git a/docs/nerfology/models/imgs/models_nerf-pipeline-light.png b/docs/nerfology/methods/imgs/models_nerf-pipeline-light.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-pipeline-light.png rename to docs/nerfology/methods/imgs/models_nerf-pipeline-light.png diff --git a/docs/nerfology/models/imgs/models_nerf-pipeline-renderer-dark.png b/docs/nerfology/methods/imgs/models_nerf-pipeline-renderer-dark.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-pipeline-renderer-dark.png rename to docs/nerfology/methods/imgs/models_nerf-pipeline-renderer-dark.png diff --git a/docs/nerfology/models/imgs/models_nerf-pipeline-renderer-light.png b/docs/nerfology/methods/imgs/models_nerf-pipeline-renderer-light.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-pipeline-renderer-light.png rename to docs/nerfology/methods/imgs/models_nerf-pipeline-renderer-light.png diff --git a/docs/nerfology/models/imgs/models_nerf-pipeline-sampler-dark.png b/docs/nerfology/methods/imgs/models_nerf-pipeline-sampler-dark.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-pipeline-sampler-dark.png rename to docs/nerfology/methods/imgs/models_nerf-pipeline-sampler-dark.png diff --git a/docs/nerfology/models/imgs/models_nerf-pipeline-sampler-light.png b/docs/nerfology/methods/imgs/models_nerf-pipeline-sampler-light.png similarity index 100% rename from docs/nerfology/models/imgs/models_nerf-pipeline-sampler-light.png rename to docs/nerfology/methods/imgs/models_nerf-pipeline-sampler-light.png diff --git a/docs/nerfology/methods/index.md b/docs/nerfology/methods/index.md new file mode 100644 index 000000000..11b3e7cdf --- /dev/null +++ b/docs/nerfology/methods/index.md @@ -0,0 +1,30 @@ +# Methods + +We provide a set of pre implemented nerfstudio methods. One of the goals of nerfstudio is to modularize the various NeRF techniques as much as possible. As a result, many of the techniques from these pre-implemented methods can be mixed. + +## Running a method + +It's easy! + +```bash +ns-train METHOD_NAME +``` + +To list the available methods run: + +```bash +ns-train --help +``` + +## Guides + +In addition to their implementations, we have provided guides that walk through each of these method. + +```{toctree} + :maxdepth: 1 + NeRF + Mip-NeRF + Nerfacto + Instant-NGP + Semantic NeRF-W +``` diff --git a/docs/nerfology/models/instant_ngp.md b/docs/nerfology/methods/instant_ngp.md similarity index 100% rename from docs/nerfology/models/instant_ngp.md rename to docs/nerfology/methods/instant_ngp.md diff --git a/docs/nerfology/models/mipnerf.md b/docs/nerfology/methods/mipnerf.md similarity index 100% rename from docs/nerfology/models/mipnerf.md rename to docs/nerfology/methods/mipnerf.md diff --git a/docs/nerfology/models/nerf.md b/docs/nerfology/methods/nerf.md similarity index 100% rename from docs/nerfology/models/nerf.md rename to docs/nerfology/methods/nerf.md diff --git a/docs/nerfology/methods/nerfacto.md b/docs/nerfology/methods/nerfacto.md new file mode 100644 index 000000000..755033884 --- /dev/null +++ b/docs/nerfology/methods/nerfacto.md @@ -0,0 +1,25 @@ +# Nerfacto + +

Our *defacto* method.

+ +### Running the Method + +```bash +ns-train nerfacto --help +``` + +## Method + +### Overview + +```{admonition} Note +This guide is coming soon. This is our flagship method that we encourage creators to use when making videos. It uses techniques from [Mip-NeRF 360](https://jonbarron.info/mipnerf360/) and [Instant-NGP](https://nvlabs.github.io/instant-ngp/). +``` + +Most of the code for this method takes place in the `NerfactoModel` class. + +```{button-link} https://www.matthewtancik.com/nerf +:color: primary +:outline: +See the code! +``` diff --git a/docs/nerfology/models/semantic_nerfw.md b/docs/nerfology/methods/semantic_nerfw.md similarity index 100% rename from docs/nerfology/models/semantic_nerfw.md rename to docs/nerfology/methods/semantic_nerfw.md diff --git a/docs/nerfology/models/index.md b/docs/nerfology/models/index.md deleted file mode 100644 index ccd6eacaf..000000000 --- a/docs/nerfology/models/index.md +++ /dev/null @@ -1,30 +0,0 @@ -# Models - -We provide a set of pre implemented nerfstudio models. One of the goals of nerfstudio is to modularize the various NeRF techniques as much as possible. As a result, many of the techniques from these pre-implemented models can be mixed. - -## Running a model - -It's easy! - -```bash -ns-train MODEL_NAME -``` - -To list the available models run: - -```bash -ns-train --help -``` - -## Guides - -In addition to their implementations, we have provided guides that walk through each of these method. - -```{toctree} - :maxdepth: 1 - NeRF - Mip-NeRF - Mip-NeRF 360 - Instant-NGP - Semantic NeRF-W -``` diff --git a/docs/nerfology/models/mipnerf_360.md b/docs/nerfology/models/mipnerf_360.md deleted file mode 100644 index 6d095b85e..000000000 --- a/docs/nerfology/models/mipnerf_360.md +++ /dev/null @@ -1,15 +0,0 @@ -# Mip-NeRF 360 - -

Unbounded Anti-Aliased Neural Radiance Fields

- -```{button-link} https://jonbarron.info/mipnerf360/ -:color: primary -:outline: -Paper Website -``` - -### Running Model - -```bash -python scripts/train.py --config-name=graph_mipnerf_360.yaml -``` diff --git a/nerfstudio/configs/model_configs.py b/nerfstudio/configs/method_configs.py similarity index 95% rename from nerfstudio/configs/model_configs.py rename to nerfstudio/configs/method_configs.py index c7301f6ba..bfc25d390 100644 --- a/nerfstudio/configs/model_configs.py +++ b/nerfstudio/configs/method_configs.py @@ -41,7 +41,7 @@ from nerfstudio.models.vanilla_nerf import NeRFModel from nerfstudio.pipelines.base_pipeline import VanillaPipelineConfig from nerfstudio.pipelines.dynamic_batch import DynamicBatchPipelineConfig -model_configs: Dict[str, Config] = {} +method_configs: Dict[str, Config] = {} descriptions = { "nerfacto": "[bold green]Recommended[/bold green] Real-time model tuned for real captures. " + "This model will be continually updated.", @@ -53,7 +53,7 @@ descriptions = { "tensorf": "Fast model designed for bounded scenes.", } -model_configs["nerfacto"] = Config( +method_configs["nerfacto"] = Config( method_name="nerfacto", trainer=TrainerConfig(steps_per_eval_batch=500, steps_per_save=2000, mixed_precision=True), pipeline=VanillaPipelineConfig( @@ -76,7 +76,7 @@ model_configs["nerfacto"] = Config( vis="viewer", ) -model_configs["instant-ngp"] = Config( +method_configs["instant-ngp"] = Config( method_name="instant-ngp", trainer=TrainerConfig(steps_per_eval_batch=500, steps_per_save=2000, mixed_precision=True), pipeline=DynamicBatchPipelineConfig( @@ -93,7 +93,7 @@ model_configs["instant-ngp"] = Config( vis="viewer", ) -model_configs["mipnerf-360"] = Config( +method_configs["mipnerf-360"] = Config( method_name="mipnerf-360", trainer=TrainerConfig(steps_per_eval_batch=200), pipeline=VanillaPipelineConfig( @@ -115,7 +115,7 @@ model_configs["mipnerf-360"] = Config( }, ) -model_configs["mipnerf"] = Config( +method_configs["mipnerf"] = Config( method_name="mipnerf", pipeline=VanillaPipelineConfig( datamanager=VanillaDataManagerConfig(dataparser=BlenderDataParserConfig(), train_num_rays_per_batch=8192), @@ -135,7 +135,7 @@ model_configs["mipnerf"] = Config( }, ) -model_configs["semantic-nerfw"] = Config( +method_configs["semantic-nerfw"] = Config( method_name="semantic-nerfw", trainer=TrainerConfig(steps_per_eval_batch=500, steps_per_save=2000, mixed_precision=True), pipeline=VanillaPipelineConfig( @@ -158,7 +158,7 @@ model_configs["semantic-nerfw"] = Config( vis="viewer", ) -model_configs["vanilla-nerf"] = Config( +method_configs["vanilla-nerf"] = Config( method_name="vanilla-nerf", pipeline=VanillaPipelineConfig( datamanager=VanillaDataManagerConfig( @@ -174,7 +174,7 @@ model_configs["vanilla-nerf"] = Config( }, ) -model_configs["tensorf"] = Config( +method_configs["tensorf"] = Config( method_name="tensorf", trainer=TrainerConfig(mixed_precision=True), pipeline=VanillaPipelineConfig( @@ -201,7 +201,7 @@ model_configs["tensorf"] = Config( AnnotatedBaseConfigUnion = dcargs.extras.subcommand_type_from_defaults( - defaults=model_configs, descriptions=descriptions + defaults=method_configs, descriptions=descriptions ) """Union[] type over config types, annotated with default instances for use with dcargs.cli(). Allows the user to pick between one of several base configurations, and diff --git a/scripts/train.py b/scripts/train.py index 0f6fbb235..797b3a5e2 100755 --- a/scripts/train.py +++ b/scripts/train.py @@ -20,7 +20,7 @@ import torch.multiprocessing as mp import yaml from nerfstudio.configs import base_config as cfg -from nerfstudio.configs.model_configs import AnnotatedBaseConfigUnion +from nerfstudio.configs.method_configs import AnnotatedBaseConfigUnion from nerfstudio.engine.trainer import train_loop from nerfstudio.utils import comms, profiler diff --git a/tests/test_train.py b/tests/test_train.py index 0f8aabaa5..b9890ee9b 100644 --- a/tests/test_train.py +++ b/tests/test_train.py @@ -10,7 +10,7 @@ from pathlib import Path import pytest from nerfstudio.configs.base_config import Config -from nerfstudio.configs.model_configs import model_configs +from nerfstudio.configs.method_configs import method_configs from nerfstudio.data.dataparsers.blender_dataparser import BlenderDataParserConfig from nerfstudio.engine.trainer import train_loop @@ -48,13 +48,13 @@ def set_reduced_config(config: Config): @pytest.mark.filterwarnings("ignore::DeprecationWarning") def test_train(): """test run train script works properly""" - all_config_names = model_configs.keys() + all_config_names = method_configs.keys() for config_name in all_config_names: if config_name in BLACKLIST: print("skipping", config_name) continue print(f"testing run for: {config_name}") - config = model_configs[config_name] + config = method_configs[config_name] config = set_reduced_config(config) train_loop(local_rank=0, world_size=0, config=config)