diff --git a/docs/quickstart/custom_dataset.md b/docs/quickstart/custom_dataset.md
index bf3d6b82c..922b890d8 100644
--- a/docs/quickstart/custom_dataset.md
+++ b/docs/quickstart/custom_dataset.md
@@ -110,16 +110,17 @@ cd vcpkg
## Record3D Capture
-Nerfstudio can also be trained directly from >=iPhone 12 Pro captures from the [Record3D app](https://record3d.app/). This uses the iPhone's LiDAR sensors to calculate camera poses, so COLMAP is not needed.
+Nerfstudio can also be trained directly from >=iPhone 12 Pro captures from the [Record3D app](https://record3d.app/). This uses the iPhone's LiDAR sensors to calculate camera poses, so COLMAP is not needed.
-Record a video and export with the EXR + JPG sequence format.
+Record a video and export with the EXR + JPG sequence format.
Then, move the exported capture folder from your iPhone to your computer.
+
```
-ns-train nerfacto --pipeline.datamanager.camera-optimizer.mode SO3xR3 record3d-data --data {RECORD3D_CAPTURE_DIR/EXR_RGBD}
+ns-train nerfacto record3d-data --data {RECORD3D_CAPTURE_DIR/EXR_RGBD}
```
You can try with our data to see the correct formatting.
@@ -130,8 +131,6 @@ ns-download-data --dataset record3d
This will download data to `data/record3d/bear`. Then you can train, and don't forget to open up the viewer.
-```python
-ns-train nerfacto --pipeline.datamanager.camera-optimizer.mode SO3xR3 record3d-data --data data/record3d/bear
+```shell
+ns-train nerfacto record3d-data --data data/record3d/bear
```
-
-Notice we are adding the option `--pipeline.datamanager.camera-optimizer.mode SO3xR3`, which is experimental but turns on camera pose optimization for higher quality results with record3d. This is because the camera poses from record3d are quite noisy, unlike those from COLMAP (from the `ns-process-data` script).
diff --git a/docs/quickstart/first_nerf.md b/docs/quickstart/first_nerf.md
index cbf09d0b6..9bc9979d7 100644
--- a/docs/quickstart/first_nerf.md
+++ b/docs/quickstart/first_nerf.md
@@ -13,7 +13,7 @@ ns-download-data --dataset=nerfstudio --capture=poster
:class: info
Use `ns-download-data --help` to view all currently available datasets.
- :::
+:::
The resulting script should download and unpack the dataset as follows:
@@ -32,6 +32,7 @@ The resulting script should download and unpack the dataset as follows:
## Training a model
See which models are available.
+
```bash
ns-train --help
```
@@ -49,6 +50,7 @@ ns-train nerfacto
```
Run a nerfacto model with different data and port.
+
```
ns-train nerfacto --vis viewer --data data/nerfstudio/poster --viewer.websocket-port 7007
```
@@ -56,37 +58,44 @@ ns-train nerfacto --vis viewer --data data/nerfstudio/poster --viewer.websocket-
:::{admonition} Warning
:class: warning
-* You may have to change the ports, and be sure to forward the "websocket-port".
-* All data configurations must go at the end. In this case, `nerfstudio-data` and all of its corresponding configurations come at the end after the model and viewer specification.
+- You may have to change the ports, and be sure to forward the "websocket-port".
+- All data configurations must go at the end. In this case, `nerfstudio-data` and all of its corresponding configurations come at the end after the model and viewer specification.
:::
## Intro to nerfstudio CLI and Configs
+
Nerfstudio allows customization of training and eval configs from the CLI in a powerful way, but there are some things to understand.
The most demonstrative and helpful example of the CLI structure is the difference in output between the following commands:
+
```bash
ns-train -h
```
+
```bash
ns-train nerfacto -h nerfstudio-data
```
+
```bash
ns-train nerfacto nerfstudio-data -h
```
-In each of these examples, the -h applies to the previous subcommand (`ns-train`, `nerfacto`, and `nerfstudio-data`).
+In each of these examples, the -h applies to the previous subcommand (`ns-train`, `nerfacto`, and `nerfstudio-data`).
-In the first example, we get the help menu for the `ns-train` script.
+In the first example, we get the help menu for the `ns-train` script.
-In the second example, we get the help menu for the `nerfacto` model.
+In the second example, we get the help menu for the `nerfacto` model.
In the third example, we get the help menu for the `nerfstudio-data` dataparser.
With our scripts, your arguments will apply to the preceding subcommand in your command, and thus where you put your arguments matters! Any optional arguments you discover from running
+
```bash
ns-train nerfacto -h nerfstudio-data
```
+
need to come directly after the `nerfacto` subcommand since these optional arguments only belong to the `nerfacto` subcommand:
+
```bash
ns-train nerfacto nerfstudio-data
```
@@ -102,33 +111,36 @@ For slower methods where the viewer is not recommended, we default to [Wandb](ht
:::{admonition} Attention
:class: attention
-- Currently we only support using a single viewer at a time.
+- Currently we only support using a single viewer at a time.
- To toggle between Wandb, Tensorboard, or our Web-based Viewer, you can specify `--vis VIS_OPTION`, where `VIS_OPTION` is one of {viewer,wandb,tensorboard}.
:::
#### Rendering videos
+
We also provide options to render out the scene of a trained model with a custom trajectory and save the output to a video.
```bash
ns-render --load-config={PATH_TO_CONFIG} --traj=spiral --output-path=output.mp4
```
-While we provide pre-specified trajectory options, `--traj={spiral, interp, filename}` we can also specify a custom trajectory if we specify `--traj=filename --camera-path-filename {PATH}`.
+While we provide pre-specified trajectory options, `--traj={spiral, interp, filename}` we can also specify a custom trajectory if we specify `--traj=filename --camera-path-filename {PATH}`.
:::{admonition} Tip
:class: info
After running the training, the config path is logged to the terminal under "[base_config.py:263] Saving config to:"
- :::
+:::
:::{admonition} See Also
:class: seealso
-This quickstart allows you to preform everything in a headless manner.
-We also provide a web-based viewer that allows you to easily monitor training or render out custom trajectories.
+This quickstart allows you to preform everything in a headless manner.
+We also provide a web-based viewer that allows you to easily monitor training or render out custom trajectories.
See our [viewer docs](viewer_quickstart.md) for more.
- :::
+:::
## Evaluating Runs
+
Calculate the psnr of your trained model and save to a json file.
+
```bash
ns-eval --load-config={PATH_TO_CONFIG} --output-path=output.json
```
diff --git a/nerfstudio/cameras/camera_optimizers.py b/nerfstudio/cameras/camera_optimizers.py
index c773d5e71..324acc1f7 100644
--- a/nerfstudio/cameras/camera_optimizers.py
+++ b/nerfstudio/cameras/camera_optimizers.py
@@ -41,7 +41,7 @@ class CameraOptimizerConfig(cfg.InstantiateConfig):
_target: Type = field(default_factory=lambda: CameraOptimizer)
- mode: Literal["off", "SO3xR3", "SE3"] = "off"
+ mode: Literal["off", "SO3xR3", "SE3"] = "SO3xR3"
"""Pose optimization strategy to use. If enabled, we recommend SO3xR3."""
position_noise_std: float = 0.0
diff --git a/nerfstudio/engine/optimizers.py b/nerfstudio/engine/optimizers.py
index 0af13eb91..5048fe26c 100644
--- a/nerfstudio/engine/optimizers.py
+++ b/nerfstudio/engine/optimizers.py
@@ -42,7 +42,8 @@ class OptimizerConfig(base_config.PrintableConfig):
def setup(self, params) -> Any:
"""Returns the instantiated object using the config."""
kwargs = vars(self)
- del kwargs["_target"]
+ if "_target" in kwargs:
+ del kwargs["_target"]
return self._target(params, **kwargs)