diff --git a/docs/tutorials/pipelines/creating_pipelines.ipynb b/docs/tutorials/pipelines/creating_pipelines.ipynb
index 972bb54b9..a74f447cb 100644
--- a/docs/tutorials/pipelines/creating_pipelines.ipynb
+++ b/docs/tutorials/pipelines/creating_pipelines.ipynb
@@ -6,19 +6,98 @@
"source": [
"# Creating Custom Pipelines\n",
"\n",
- "Here we explain how to create custom pipelines in nerfactory. Pipelines are composed of two components, namely a Dataloader and a Model. We'll show how to make an incremental dataloader with multiple scenes, a model with scene conditioning, and importance sampling at pixels with high loss.\n",
+ "> Our goal is to enable Nerfactory users to implement an entire NeRF method by only editing one file.\n",
"\n",
- "The extensible features that we show in this tutorial are the following:\n",
+ "Here we explain how to create custom pipelines with nerfactory. Pipelines are composed of two components, namely a Dataloader and a Model. The pipeline is responsible for routing RayBundle instances returned from the Dataloader into the Model.\n",
+ "\n",
+ "A NeRF method is implemented as a Pipeline. Users can create a Pipeline with a Dataloader and Model. We provide default implementations for these components prefixed with the name Vanilla (e.g., `VanillaPipeline`, `VanillaDataloader` which inherit from the `Pipeline` and `Dataloader` class, respectively) and specific Models (e.g., `InstantNGPModel` or `TensoRFModel` which inherit from the `Model` class). With most NeRF methods, `VanillaPipeline` and `VanillaDataloader` can be used and only the model needs to be changed. We provide many already implmented Models for people to get started with 3D reconstruction. However, in this tutorial we will demonstrate how to customize each of the Pipeline, Dataloader, and Model with an example.\n",
+ "\n",
+ "We'll show how to make an incremental dataloader where we progressively add cameras to train with from multiple scenes and importance sample rays from pixels with a high loss. The extensible features that we show in this tutorial are the following:\n",
"- a Dataloader that incrementally adds cameras\n",
"- a Dataloader that uses multiple scenes\n",
"- a Model that is conditioned on the scene\n",
- "- a Dataloader PixelSampler that samples more densely in regions with high loss\n",
+ "- a Pipeline that modifies the Dataloader's PixelSampler to sample more rays in regions with high loss"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Model Components\n",
"\n",
- "Our goal is to enable Nerfactory users to create an entire custom Pipeline by only editing one file.\n",
+ "> The model renders values from 3D line segments defined by a RayBundle.\n",
"\n",
- "```text\n",
- "#TODO(ethan): show a figure depicting the different modules that go into a pipeline\n",
- "```"
+ "We provide Models and Model Components (i.e., Fields and Field Modules) which can be strung together to create a custom model.\n",
+ "\n",
+ "\n",
+ "Models
\n",
+ "
\n",
+ "Vanilla NeRF Model\n",
+ "Mip NeRF Model\n",
+ "Mip NeRF 360 Model\n",
+ "Instant NGP Model\n",
+ "NeRF-W Model\n",
+ "Semantic NeRF Model\n",
+ " \n",
+ "\n",
+ "
\n",
+ "\n",
+ "\n",
+ "Model Components
\n",
+ "
\n",
+ "Fields:\n",
+ "Vanilla NeRF Field\n",
+ "Instant NGP Field\n",
+ "
\n",
+ "Field Modules:\n",
+ "Encodings\n",
+ "Embeddings\n",
+ "Field Heads\n",
+ "Field Losses\n",
+ "MLP\n",
+ "Spatial Distortions\n",
+ " \n",
+ "\n",
+ "#### Dataloader Components\n",
+ "\n",
+ "> The Dataloader provides a RayBundle (3D line segments with metadata needed to run the forward pass) and a dictionary of information needed at train-time to supervise the pipeline components.\n",
+ "\n",
+ "Similar to the Model components, we provide Dataloader components that are strung together to generate RayBundle instances. A RayBundle contains everything needed to generate a ray (e.g., origin and direction, near and far planes) as well as any additional metadata that the Model requires (e.g., camera index, scene index, etc.).\n",
+ "\n",
+ "\n",
+ "Dataloader Components
\n",
+ "
\n",
+ "Scene Datasets:
\n",
+ " Takes a data location and returns a DatasetInputs instance. A DatasetInputs will contain all data needed throughout the pipeline.\n",
+ "Vanilla Image Dataset\n",
+ "Panoptic Image Dataset\n",
+ "
\n",
+ "Image Datasets:
\n",
+ " Takes image filename information and can return images.\n",
+ "Vanilla Image Dataset\n",
+ "Panoptic Image Dataset\n",
+ "
\n",
+ "Image Samplers:
\n",
+ " Takes an Image Dataset and samples images from it.\n",
+ "Vanilla Image Sampler\n",
+ "Cache Image Sampler\n",
+ "
\n",
+ "Pixel Samplers:
\n",
+ " Takes sampled images and returns pixel locations.\n",
+ "Vanilla Image Sampler\n",
+ "Cache Image Sampler\n",
+ "
\n",
+ "Pixel Samplers:
\n",
+ " Takes sampled images and returns pixel locations.\n",
+ "Vanilla Pixel Sampler\n",
+ "
\n",
+ "Ray Generators:
\n",
+ " Takes cameras and pixel locations and returns RayBundle objects.\n",
+ "
\n",
+ "\n",
+ "Colliders:
\n",
+ " Takes RayBundles and clips them according .\n",
+ " "
]
},
{
@@ -42,25 +121,14 @@
"import torch\n",
"\n",
"from nerfactory.utils.config import DataloaderConfig, ModelConfig, PipelineConfig, ViewerConfig\n",
- "\n",
"from nerfactory.dataloaders.base import Dataloader\n",
"from nerfactory.dataloaders.structs import DatasetInputs\n",
"from nerfactory.models.base import Model\n",
"from nerfactory.pipelines.base import Pipeline\n",
- "\n",
"from nerfactory.models.instant_ngp import NGPModel\n",
"from nerfactory.cameras.rays import RayBundle"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### RayBundle class\n",
- "\n",
- "In the RayBundle class, we allow uses to add non-default attributes for conditioning.\n"
- ]
- },
{
"cell_type": "code",
"execution_count": null,
@@ -68,7 +136,7 @@
"outputs": [],
"source": [
"class CustomDataloaderConfig(DataloaderConfig):\n",
- " _target = CustomDataloader\n",
+ " _target = \"CustomDataloader\"\n",
" scene_names: List[str] = [\"chair\", \"drums\", \"fern\", \"lego\"]\n",
" steps_per_add_cameras: int = 100 # every X iterations, add more cameras\n",
" num_cameras_per_add: int = 10 # number of cameras to add\n",
@@ -128,7 +196,7 @@
"\n",
"\n",
"class CustomNGPModelConfig(ModelConfig):\n",
- " _target = CustomNGPModel\n",
+ " _target = \"CustomNGPModel\"\n",
" coarse_field: str = \"temp\"\n",
" fine_field: str = \"temp2\"\n",
"\n",