mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-13 11:24:00 +08:00
Update docs (#65)
+ Clean up data setup docs + Clean up visualize data ipynb + Enable interactive ploty in docs
This commit is contained in:
1 parent
336d348345
commit
2bc6d9cc63
8 files changed
+5125
-5118
No files matched your search
@@ -1,8 +1,8 @@
|
||||
# Dataset configuration
|
||||
|
||||
#### Referring to a specific dataset
|
||||
#### Specifying dataset
|
||||
|
||||
Here is how we refer to a dataset. We have a `dataset_inputs_train` and a `dataset_inputs_eval` config. These live under the `data` directory. You can see `configs/graph_default.yaml` for more details on what a full config would look like.
|
||||
The dataset path and type is specified in the model config. Both `dataset_inputs_train` and a `dataset_inputs_eval` need to be set. You can see `configs/graph_default.yaml` for more details on what a full config would look like.
|
||||
|
||||
```yaml
|
||||
data:
|
||||
@@ -18,7 +18,7 @@ data:
|
||||
alpha_color: white
|
||||
```
|
||||
|
||||
#### Sanity check with a notebook
|
||||
#### Visualize dataset
|
||||
|
||||
You can use `notebooks/visualize_dataset.ipynb` to see how your formatted dataset looks. This code will load a dataset from a yaml config, show the camera poses, and visualize rays with the specified collider in the config. TODO: add a better visualization with images too
|
||||
|
||||
@@ -53,4 +53,16 @@ Download
|
||||
|
||||
```yaml
|
||||
dataset_format: instant_ngp
|
||||
```
|
||||
|
||||
###### MipNeRF 360
|
||||
|
||||
```{button-link} https://jonbarron.info/mipnerf360/
|
||||
:color: primary
|
||||
:outline:
|
||||
Download
|
||||
```
|
||||
|
||||
```yaml
|
||||
dataset_format: mipnerf_360
|
||||
```
|
||||
@@ -1,8 +1,18 @@
|
||||
# Using custom data
|
||||
|
||||
#### Running COLMAP on your own images
|
||||
Training model on existing datasets is only so fun. If you would like to train on self captured data you will need to process the data into an existing format. Specifically we need to know the camera poses for each image. [COLMAP](https://github.com/colmap/colmap) is a standard tool for extracting poses. It is possible to use other methods like [SLAM](https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping) or hardware recorded poses. We intend to add documentation for these other methods in the future.
|
||||
|
||||
Please download [this file](https://github.com/NVlabs/instant-ngp/blob/07d8e2ca7232f97397ab73af9b56c7db639d3445/scripts/colmap2nerf.py) and place it at `scripts/colmap2nerf.py` courtesy of the [Instant-NGP](https://github.com/NVlabs/instant-ngp) authors. This script will use [COLMAP](https://github.com/colmap/colmap) to process images of a video file into a reconstruction with camera poses. You can see their write-up [here](https://github.com/NVlabs/instant-ngp/blob/master/docs/nerf_dataset_tips.md) for instructions.
|
||||
#### Recover poses using COLMAP
|
||||
:::{admonition} Notes
|
||||
:class: warning
|
||||
|
||||
+ This method assumes the images were captured with a standard _pinhole-like_ camera. 360° captures will not work.
|
||||
+ COLMAP is notoriously finicky. Try your best to capture overlapping, non-blurry images.
|
||||
:::
|
||||
|
||||
These instructions will recover poses for your own images using [COLMAP](https://github.com/colmap/colmap) and save the data in the `instant_ngp` format.
|
||||
|
||||
Please download [this file](https://github.com/NVlabs/instant-ngp/blob/07d8e2ca7232f97397ab73af9b56c7db639d3445/scripts/colmap2nerf.py) and place it at `scripts/colmap2nerf.py` courtesy of the [Instant-NGP](https://github.com/NVlabs/instant-ngp) authors. This script will use COLMAP to process images of a video file into a reconstruction with camera poses. You can see their write-up [here](https://github.com/NVlabs/instant-ngp/blob/master/docs/nerf_dataset_tips.md) for instructions.
|
||||
|
||||
For example, maybe we have a video named `bear.mp4`. We can use the commands described in the Instant-NGP repo to create our dataset. We first create a a data folder. Then, we navigate to this folder. Finally, we run the colmap2nerf.py script with a specified `video_fps` and `aabb_scale`. The recommended number of frames is around 50-150 and the `aabb_scale` is the extent of the scene. The origin is the center of the aabb and `aabb_scale` is the length of each side of the box.
|
||||
|
||||
@@ -29,5 +39,7 @@ python $PYRAD_DIR/scripts/colmap2nerf.py \
|
||||
|
||||
In the config set:
|
||||
```yaml
|
||||
dataset_format: instant_ngp
|
||||
...
|
||||
data_directory: data/instant_ngp/bear
|
||||
dataset_format: instant_ngp
|
||||
```
|
||||
@@ -1,7 +1,9 @@
|
||||
|
||||
# Custom Data Formats
|
||||
# Custom dataset formats
|
||||
|
||||
In this page, we explain how to use pyRad with your own data. We've implemented many common datasets inside the `pyrad/format/<dataset_format>.py` files. Each of these files implements a function called `load_<dataset_format>_data`. Each of these functions returns a `DatasetInputs` object. Furthermore, `get_dataset_inputs` in `pyrad/data/utils.py` will have to be updated to handle the new function.
|
||||
We've implemented many common datasets inside the `pyrad/format/<dataset_format>.py` files. If you have a posed image dataset that does not match these existing formats can create a custom dataset format.
|
||||
|
||||
1. Create a function `pyrad/format/<dataset_format>.py` and implements a function called `load_<dataset_format>_data` returns a `DatasetInputs` object.
|
||||
|
||||
```python
|
||||
# The DatasetInputs dataclass that is passed around to create datasets and initialize the graphs.
|
||||
@@ -29,7 +31,12 @@ def load_instant_ngp_data(
|
||||
split: str = "train", camera_translation_scalar=0.33
|
||||
) -> DatasetInputs:
|
||||
"""Returns a DatasetInputs struct."""
|
||||
```
|
||||
|
||||
|
||||
2. Add a new case to `get_dataset_inputs()` in `pyrad/data/utils.py` for the new dataset.
|
||||
|
||||
```python
|
||||
# The method signature for get_dataset_inputs.
|
||||
# Notice that the parameters match the yaml config parameters above.
|
||||
# See `pyrad/data/utils.py` for the code.
|
||||
@@ -41,4 +48,4 @@ def get_dataset_inputs(
|
||||
alpha_color: Optional[Union[str, list, ListConfig]] = None,
|
||||
) -> DatasetInputs:
|
||||
"""Makes a call to `load_<dataset_format>_data` and returns a DatasetInputs struct."""
|
||||
```
|
||||
```
|
||||
Reference in new issue
Block a user