Skip to main content

A collection of NeRF baselines for benchmarking

Project description

NerfBaselines

PyPI - Version GitHub License Downloads

NerfBaselines is a framework for evaluating and comparing existing NeRF methods. Currently, most official implementations use different dataset loaders, evaluation protocols, and metrics, which renders the comparison of methods difficult. Therefore, this project aims to provide a unified interface for running and evaluating methods on different datasets in a consistent way using the same metrics. But instead of reimplementing the methods, we use the official implementations and wrap them so that they can be run easily using the same interface.

DISCLAIMER: This project is at a very early stage of its development. Stay tuned!

Please visit the project page to see the results of implemented methods on dataset benchmarks.

Project Page + Results

Getting started

Start by installing the nerfbaselines pip package on your host system.

pip install nerfbaselines

Now you can use the nerfbaselines cli to interact with NerfBaselines.

WARNING: the default installation only installs the core nerfbaselines package which does not depend on either PyTorch or JAX. However, the LPIPS metric requires PyTorch to be installed and will be disabled otherwise. Similarly, if you install JAX and have a GPU available, the dataloading and evaluation will be faster as some parts of the pipeline will be moved to GPU. Therefore, we recommend installing the extras package by following the Advanced installation section.

The next step is to choose the backend which will be used to install different methods. At the moment there are the following backends implemented:

  • docker: Offers good isolation, requires docker to be installed and the user to have access to it (being in the docker user group).
  • apptainer: Similar level of isolation as docker, but does not require the user to have privileged access.
  • conda (not recommended): Does not require docker/apptainer to be installed, but does not offer the same level of isolation and some methods require additional dependencies to be installed. Also, some methods are not implemented for this backend because they rely on dependencies not found on conda.
  • python (not recommended): Will run everything directly in the current environment. Everything needs to be installed in the environment for this backend to work.

The backend can be set as the --backend <backend> argument or using the NB_BACKEND environment variable.

Advanced installation

The LPIPS metric requires PyTorch to be installed and will be disabled otherwise. Similarly, if you install JAX and have a GPU available, the dataloading and evaluation will be faster as some parts of the pipeline will be moved to GPU. In this section we describe how to install the packages required for LPIPS and accelerated dataloading. We recommend this as the default installation (unless there is a reason for not installing PyTorch or JAX). Select one of the following configurations:

  • CPU-only install
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install jax[cpu]
pip install 'nerfbaselines[extras]'
  • CUDA 11.8 install
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install jax[cuda11_pip]
pip install 'nerfbaselines[extras]'
  • CUDA 12.1 install
pip install torch torchvision torchaudio
pip install jax[cuda12_pip]
pip install 'nerfbaselines[extras]'

Downloading data

For some datasets, e.g. Mip-NeRF 360 or NerfStudio, the datasets can be downloaded automatically. You can specify the argument --data external://dataset/scene during training or download the dataset beforehand by running nerfbaselines download-dataset dataset/scene. Examples:

# Downloads the garden scene to the cache folder.
nerfbaselines download-dataset mipnerf360/garden

# Downloads all nerfstudio scenes to the cache folder.
nerfbaselines download-dataset nerfstudio

# Downloads kithen scene to folder kitchen
nerfbaselines download-dataset mipnerf360/kitchen -o kitchen

Training

To start the training use the nerfbaselines train --method <method> --data <data> command. Use --help argument to learn about all implemented methods and supported features.

Rendering

The nerfbaselines render --checkpoint <checkpoint> command can be used to render images from a trained checkpoint. Again, use --help to learn about the arguments.

Interactive viewer

Given a trained checkpoint, the interactive viewer can be launched as follows:

nerfbaselines viewer --checkpoint <checkpoin> --data <dataset>

Even though the argument --data <dataset> is optional, it is recommended, as for some methods some viewers use the camera poses to performa gravity alignement for better viewing experience. Again, you can use the --backend <backend> flag or NS_BACKEND=<backend> environment variable to change the backend.

Implementation status

Methods:

  • Nerfacto
  • Instant-NGP
  • Gaussian Splatting
  • Tetra-NeRF
  • Mip-NeRF 360
  • NeRF
  • Mip-NeRF
  • Zip-NeRF

Datasets/features:

  • Mip-NeRF 360 dataset
  • Blender dataset
  • any COLMAP dataset
  • any NerfStudio dataset
  • automatic dataset download
  • interactive viewer
  • undistorting images for methods that do not support complex camera models (Gaussian Splatting)
  • logging to tensorboard, wandb
  • Tanks and Temples
  • LLFF dataset
  • HDR images support
  • RAW images support
  • handling large datasets
  • loading/creating camera trajectories in the interactive viewer

Contributing

Contributions are very much welcome. Please open a PR with a dataset/method/feature that you want to contribute. The goal of this project is to slowly expand by implementing more and more methods.

License

This project is licensed under the MIT license.

Thanks

A big thanks to the authors of all implemented methods for the great work they have done.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nerfbaselines-0.0.9.tar.gz (129.7 kB view details)

Uploaded Source

Built Distribution

nerfbaselines-0.0.9-py3-none-any.whl (108.1 kB view details)

Uploaded Python 3

File details

Details for the file nerfbaselines-0.0.9.tar.gz.

File metadata

  • Download URL: nerfbaselines-0.0.9.tar.gz
  • Upload date:
  • Size: 129.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for nerfbaselines-0.0.9.tar.gz
Algorithm Hash digest
SHA256 1e8913599b8c94738dd89813afd64b7ee77996fae66b32ec16e66e41f55bbaea
MD5 4550b1b7eb46d842736b3efe8d198920
BLAKE2b-256 bf6d758d64cce1301cfef65d450834b1458e557f2dd7e197568efc44c2e61acf

See more details on using hashes here.

File details

Details for the file nerfbaselines-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for nerfbaselines-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 3137fab67713ca82ef9d190bf1452262f9bd43b4ec774dbdb86b42058b58763e
MD5 8a30e9ceb0ff54a1ee8013e2904c1be2
BLAKE2b-256 73b0c8044a6d68a69b214ef85f3d4bc1adc51dae090a8bc20f978c6dcc4967c2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page