Files
nerfstudio/docs/quickstart/first_nerf.md
T
evonneng 5e56e7b229 update quickstart + readme (#641)
* updated quickstart and readme

* damn ctrl c on macs
2022-10-03 22:38:43 -07:00

2.4 KiB

Training your first model

Downloading data

Download the original NeRF Blender dataset. We support the major datasets and allow users to create their own dataset, described in detail [here TODO].

ns-download-data --dataset=blender
ns-download-data --dataset=nerfstudio --capture=poster

Use --help to view all currently available datasets. The resulting script should download and unpack the dataset as follows:

|─ nerfstudio/
   ├─ data/
   |  ├─ blender/
   |     ├─ fern/
   |     ├─ lego/
         ...
      |- <dataset_format>/
         |- <scene>
         ...

Training a model

To run with all the defaults, e.g. vanilla nerf method with the blender lego image

Run a vanilla nerf model.

ns-train vanilla-nerf

Run a nerfacto model.

ns-train nerfacto

Run with nerfstudio data. You'll may have to change the ports, and be sure to forward the "websocket-port".

ns-train nerfacto --vis viewer --viewer.zmq-port 8001 --viewer.websocket-port 8002 nerfstudio-data --pipeline.datamanager.dataparser.data-directory data/nerfstudio/poster --pipeline.datamanager.dataparser.downscale-factor 4

Visualizing training runs

If you are using a fast NeRF variant (ie. Instant-NGP), we recommend using our viewer. See our viewer docs for more details. The viewer will allow interactive visualization of training in realtime.

Additionally, if you run everything with the default configuration, by default, we use TensorBoard to log all training curves, test images, and other stats. Once the job is launched, you will be able to track training by launching the tensorboard in outputs/blender_lego/vanilla_nerf/<timestamp>/<events.tfevents>.

tensorboard --logdir outputs

Rendering a Trajectory

To evaluate the trained NeRF, we provide an evaluation script that allows you to do benchmarking (see our benchmarking workflow) or to render out the scene with a custom trajectory and save the output to a video.

ns-render --load-config=outputs/blender_lego/instant_ngp/2022-07-07_230905/config.yml --traj=spiral --output-path=output.mp4

Please note, 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 trajectories. See our viewer docs for more.