4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 10:34:29 +08:00
nerfstudio/docs/tutorials/data/creating_dataset.md
2022-06-28 16:51:08 -07:00

1.5 KiB

Using custom data

Running COLMAP on your own images

Please download this file and place it at scripts/colmap2nerf.py courtesy of the 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 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.

# Navigate to the repo.
cd /path/to/pyrad

# Setup the environment variables.
PYRAD_DIR=`pwd`
DATASET_FORMAT=instant_ngp
DATASET_NAME=bear

# Create and navigate to the data folder.
mkdir data/$DATASET_FORMAT/$DATASET_NAME
cd data/$DATASET_FORMAT/$DATASET_NAME

# Run the COLMAP script.
python $PYRAD_DIR/scripts/colmap2nerf.py \
    --video_in /path/to/bear.mp4 \
    --video_fps 2 \
    --run_colmap \
    --aabb_scale 16

In the config set:

dataset_format: instant_ngp