mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-21 07:05:44 +08:00
dataset_inputs -> dataparser_outputs (#627)
This commit is contained in:
1 parent
ef5384afb3
commit
3efd3c3298
17 files changed
+52
-179
No files matched your search
@@ -1,79 +0,0 @@
|
||||
# Dataset configuration
|
||||
|
||||
#### Specifying dataset
|
||||
|
||||
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:
|
||||
dataset_inputs_train:
|
||||
data_directory: data/instant_ngp/fox
|
||||
dataset_format: instant_ngp
|
||||
alpha_color: white
|
||||
dataset_inputs_eval:
|
||||
data_directory: data/instant_ngp/fox
|
||||
dataset_format: instant_ngp
|
||||
alpha_color: white
|
||||
```
|
||||
|
||||
#### Visualize dataset
|
||||
|
||||
TODO
|
||||
|
||||
#### Supported datasets
|
||||
|
||||
We include support for a set of standard dataset formats.
|
||||
|
||||
###### Blender Synthetic
|
||||
|
||||
```{button-link} https://drive.google.com/drive/u/1/folders/128yBriW1IG_3NJ5Rp7APSTZsJqdJdfc1
|
||||
:color: primary
|
||||
:outline:
|
||||
Download
|
||||
```
|
||||
|
||||
```yaml
|
||||
dataset_format: blender
|
||||
```
|
||||
|
||||
Classic NeRF dataset including the "lego bulldozer" scene that was released with the original NeRF paper.
|
||||
|
||||
###### Instant NGP
|
||||
|
||||
```{button-link} https://github.com/NVlabs/instant-ngp#nerf-fox
|
||||
:color: primary
|
||||
:outline:
|
||||
Download
|
||||
```
|
||||
|
||||
```yaml
|
||||
dataset_format: instant_ngp
|
||||
```
|
||||
|
||||
###### MipNeRF 360
|
||||
|
||||
```{button-link} https://jonbarron.info/mipnerf360/
|
||||
:color: primary
|
||||
:outline:
|
||||
Download
|
||||
```
|
||||
|
||||
```yaml
|
||||
dataset_format: mipnerf_360
|
||||
```
|
||||
|
||||
###### Record3D
|
||||
|
||||
```{button-link} https://record3d.app/
|
||||
:color: primary
|
||||
:outline:
|
||||
Download
|
||||
```
|
||||
|
||||
```yaml
|
||||
dataset_format: record_3d
|
||||
```
|
||||
|
||||
Directly import dataset recorded 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.
|
||||
@@ -1,46 +0,0 @@
|
||||
# Custom dataset formats
|
||||
|
||||
We've implemented many common datasets inside the `nerfstudio/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 `nerfstudio/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.
|
||||
# See `nerfstudio/data/structs.py` for the code.
|
||||
@dataclass
|
||||
class DatasetInputs:
|
||||
"""Dataset inputs are used to initialize datasets and the NeRF graph."""
|
||||
|
||||
image_filenames: List[str]
|
||||
intrinsics: torch.tensor = None
|
||||
camera_to_world: torch.tensor = None
|
||||
mask_filenames: List[str] = None
|
||||
depth_filenames: List[str] = None
|
||||
scene_box: SceneBox = SceneBox()
|
||||
semantics: Semantics = Semantics()
|
||||
point_cloud: PointCloud = PointCloud()
|
||||
alpha_color: Optional[TensorType[3]] = None
|
||||
|
||||
# The method signature for the `instant_ngp` dataset format.
|
||||
# See `nerfstudio/data/format/instant_ngp.py` for the code.
|
||||
def load_instant_ngp_data(
|
||||
basedir: str,
|
||||
split: str = "train", camera_translation_scalar=0.33
|
||||
) -> DatasetInputs:
|
||||
"""Returns a DatasetInputs struct."""
|
||||
```
|
||||
|
||||
2. Add a new case to `get_dataset_inputs()` in `nerfstudio/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 `nerfstudio/data/utils.py` for the code.
|
||||
def get_dataset_inputs(
|
||||
data_directory: str,
|
||||
dataset_format: str,
|
||||
split: str,
|
||||
alpha_color: Optional[Union[str, list, ListConfig]] = None,
|
||||
) -> DatasetInputs:
|
||||
"""Makes a call to `load_<dataset_format>_data` and returns a DatasetInputs struct."""
|
||||
```
|
||||
@@ -4,6 +4,4 @@ Data Setup
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
choosing_dataset.md
|
||||
creating_dataset.md
|
||||
custom_dataset_format.md
|
||||
Reference in new issue
Block a user