pipeline documentation (#623)

* added images

* structuring
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-10-02 23:35:49 -07:00
1 parent 03b7c44880
commit 020662d4e4
11 files changed
+254 -12

No files matched your search

@@ -6,7 +6,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"# Creating Custom Pipelines\n", "# Creating Custom Methods\n",
"\n", "\n",
"> Our goal is to enable nerfstudio users to implement an entire NeRF method by only editing one file.\n", "> Our goal is to enable nerfstudio users to implement an entire NeRF method by only editing one file.\n",
"\n", "\n",
@@ -254,8 +254,6 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"# Creating pipelines from a config\n",
"\n",
"Now we show how to create a pipeline from a config, which has the following form:\n", "Now we show how to create a pipeline from a config, which has the following form:\n",
"\n", "\n",
"```python\n", "```python\n",
@@ -345,10 +343,10 @@
}, },
"vscode": { "vscode": {
"interpreter": { "interpreter": {
"hash": "100252972d4ee5286ab455ef1c778abde05b4affca9d1be78633d3797abf7e8c" "hash": "b7b86c17c0dfd6b313529972d424f2e075cc198a46cda005757126afe8133c7b"
} }
} }
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 2 "nbformat_minor": 2
} }
@@ -0,0 +1,34 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# DataManagers\n",
"\n",
"```{image} imgs/datamanagers.png\n",
":align: center\n",
"```"
]
}
],
"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": "b7b86c17c0dfd6b313529972d424f2e075cc198a46cda005757126afe8133c7b"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
+158
View File
@@ -0,0 +1,158 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# DataParsers\n",
"\n",
"```{image} imgs/dataparsers.png\n",
":align: center\n",
"```\n",
"\n",
"## What is a DataParser?\n",
"\n",
"The dataparser returns `DataparserOutputs`, which puts all the various datasets into a common format.\n",
"\n",
"```python\n",
"@dataclass\n",
"class DataparserOutputs:\n",
" \"\"\"Dataset inputs for the image dataset and the ray generator.\"\"\"\n",
"\n",
" image_filenames: List[Path]\n",
" \"\"\"Filenames for the images.\"\"\"\n",
" cameras: Cameras\n",
" \"\"\"Camera object storing collection of camera information in dataset\"\"\"\n",
" alpha_color: Optional[TensorType[3]] = None\n",
" \"\"\"color of dataset background\"\"\"\n",
" scene_box: SceneBox = SceneBox()\n",
" \"\"\"scene box of dataset. Could be used to bound the scene, or to provide the scene scale depending on model.\"\"\"\n",
" ...\n",
"\n",
"@dataclass\n",
"class DataParser:\n",
"\n",
" @abstractmethod\n",
" def _generate_dataset_inputs(self, split: str = \"train\") -> DataparserOutputs:\n",
" \"\"\"Abstract method that returns the dataparser outputs for the given split.\n",
"\n",
" Args:\n",
" split: Which dataset split to generate data for (train/eval/test).\n",
"\n",
" Returns:\n",
" DataparserOutputs for the specified dataset and split.\n",
" \"\"\"\n",
"```\n",
"\n",
"## Example\n",
"\n",
"Here is an example where we implement a DataParser for our Nerfstudio data format.\n",
"\n",
"```python\n",
"@dataclass\n",
"class NerfstudioDataParserConfig(DataParserConfig):\n",
" \"\"\"Nerfstudio dataset config\"\"\"\n",
"\n",
" _target: Type = field(default_factory=lambda: Nerfstudio)\n",
" \"\"\"Target class to instantiate.\"\"\"\n",
" data_directory: Path = Path(\"data/nerfstudio/poster\")\n",
" \"\"\"Directory specifying location of data.\"\"\"\n",
" scale_factor: float = 1.0\n",
" \"\"\"How much to scale the camera origins by.\"\"\"\n",
" downscale_factor: int = 1\n",
" \"\"\"How much to downscale images.\"\"\"\n",
" scene_scale: float = 1.0\n",
" \"\"\"How much to scale the region of interest by.\"\"\"\n",
" orientation_method: Literal[\"pca\", \"up\"] = \"up\"\n",
" \"\"\"The method to use for orientation.\"\"\"\n",
" train_split_percentage: float = 0.9\n",
" \"\"\"The percent of images to use for training. The remaining images are for eval.\n",
" \"\"\"\n",
"\n",
"@dataclass\n",
"class Nerfstudio(DataParser):\n",
" \"\"\"Nerfstudio Dataset\"\"\"\n",
"\n",
" config: NerfstudioDataParserConfig\n",
"\n",
" def _generate_dataset_inputs(self, split=\"train\") -> DataParserOutputs:\n",
" \"\"\"Returns DataParserOutputs.\"\"\"\n",
"```\n",
"\n",
"## Our Implementations\n",
"\n",
"###### Nerfstudio\n",
"\n",
"This is our custom dataparser.\n",
"\n",
"```{button-link} https://github.com/nerfstudio-project/nerfstudio/blob/master/nerfstudio/data/dataparsers/nerfstudio_dataparser.py\n",
":color: primary\n",
":outline:\n",
"See the code!\n",
"```\n",
"\n",
"###### Blender\n",
"\n",
"We support the synthetic Blender dataset from the original NeRF paper.\n",
"\n",
"```{button-link} https://github.com/nerfstudio-project/nerfstudio/blob/master/nerfstudio/data/dataparsers/blender_dataparser.py\n",
":color: primary\n",
":outline:\n",
"See the code!\n",
"```\n",
"\n",
"###### Instant NGP\n",
"\n",
"This supports the Instant NGP dataset.\n",
"\n",
"```{button-link} https://github.com/nerfstudio-project/nerfstudio/blob/master/nerfstudio/data/dataparsers/instant_ngp_dataparser.py\n",
":color: primary\n",
":outline:\n",
"See the code!\n",
"```\n",
"\n",
"###### MipNeRF 360\n",
"\n",
"```{button-link} https://github.com/nerfstudio-project/nerfstudio/blob/master/nerfstudio/data/dataparsers/mipnerf_dataparser.py\n",
":color: primary\n",
":outline:\n",
"See the code!\n",
"```\n",
"\n",
"###### Record3D\n",
"\n",
"This dataparser can use recorded data from a >= iPhone 12 Pro using the Record3D app. Record a video and export with the `EXR + JPG sequence` format. Unzip export and `rgb` folder before training.\n",
"\n",
"```{button-link} https://github.com/nerfstudio-project/nerfstudio/blob/master/nerfstudio/data/dataparsers/record3d_dataparser.py\n",
":color: primary\n",
":outline:\n",
"See the code!\n",
"```\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"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": "b7b86c17c0dfd6b313529972d424f2e075cc198a46cda005757126afe8133c7b"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

+12 -3
View File
@@ -1,10 +1,19 @@
Creating Custom Pipelines Pipelines Overview
------------------------- -------------------------
Here we show you how to create a custom pipeline. Here we show you how to create a custom pipeline.
# TODO: show a figure of what a pipeline is here
.. image:: imgs/pipelines_overview.png
:width: 400
:align: center
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
creating_pipelines.ipynb dataparsers.ipynb
creating_models.ipynb datamanagers.ipynb
models.ipynb
pipelines.ipynb
creating_new_methods.ipynb
@@ -4,7 +4,11 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Developing Custom Models\n", "# Models\n",
"\n",
"```{image} imgs/models.png\n",
":align: center\n",
"```\n",
"\n", "\n",
"In this quick tour, we will walk you through the core of training and building any NeRFs with nerfstudio.\n", "In this quick tour, we will walk you through the core of training and building any NeRFs with nerfstudio.\n",
"\n", "\n",
@@ -201,7 +205,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3.8.12 ('nerfactory')", "display_name": "Python 3.8.13 ('nerfactory')",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },
@@ -215,12 +219,12 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.12" "version": "3.8.13"
}, },
"orig_nbformat": 4, "orig_nbformat": 4,
"vscode": { "vscode": {
"interpreter": { "interpreter": {
"hash": "34c28001ff35fb390494047002768a8182dcf55b1b11415165e62ea61557ab83" "hash": "b7b86c17c0dfd6b313529972d424f2e075cc198a46cda005757126afe8133c7b"
} }
} }
}, },
+39
View File
@@ -0,0 +1,39 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Pipelines\n",
"\n",
"```{image} imgs/pipelines.png\n",
":align: center\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"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": "b7b86c17c0dfd6b313529972d424f2e075cc198a46cda005757126afe8133c7b"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}