Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

nerfacc

> 编程语言
Open source

A General NeRF Acceleration Toolbox in PyTorch.

1.5K stars0 likes1 views
WebsiteGitHub

About

A General NeRF Acceleration Toolbox in PyTorch.

https://www.nerfacc.com/

[News] 2023/04/04. If you were using nerfacc <= 0.3.5 and would like to migrate to our latest version (nerfacc >= 0.5.0), Please check the CHANGELOG on how to migrate.

NerfAcc is a PyTorch Nerf acceleration toolbox for both training and inference. It focus on efficient sampling in the volumetric rendering pipeline of radiance fields, which is universal and plug-and-play for most of the NeRFs. With minimal modifications to the existing codebases, Nerfacc provides significant speedups in training various recent NeRF papers. And it is pure Python interface with flexible APIs!

Installation

Dependence: Please install Pytorch first.

The easist way is to install from PyPI. In this way it will build the CUDA code on the first run (JIT).

bash
pip install nerfacc

Or install from source. In this way it will build the CUDA code during installation.

bash
pip install git+https://github.com/nerfstudio-project/nerfacc.git

We also provide pre-built wheels covering major combinations of Pytorch + CUDA supported by official Pytorch.

bash
# e.g., torch 1.13.0 + cu117
pip install nerfacc -f https://nerfacc-bucket.s3.us-west-2.amazonaws.com/whl/torch-1.13.0_cu117.html
Windows & Linux cu113 cu115 cu116 cu117 cu118
torch 1.11.0 ✅ ✅
torch 1.12.0 ✅ ✅
torch 1.13.0 ✅ ✅
torch 2.0.0 ✅ ✅

For previous version of nerfacc, please check here on the supported pre-built wheels.

Usage

The idea of NerfAcc is to perform efficient volumetric sampling with a computationally cheap estimator to discover surfaces. So NerfAcc can work with any user-defined radiance field. To plug the NerfAcc rendering pipeline into your code and enjoy the acceleration, you only need to define two functions with your radience field.

  • sigma_fn: Compute density at each sample. It will be used by the estimator (e.g., nerfacc.OccGridEstimator, nerfacc.PropNetEstimator) to discover surfaces.
  • rgb_sigma_fn: Compute color and density at each sample. It will be used by nerfacc.rendering to conduct differentiable volumetric rendering. This function will receive gradients to update your radiance field.

An simple example is like this:

…

Examples:

Before running those example scripts, please check the script about which dataset is needed, and download the dataset first. You could use --data_root to specify the path.

bash
# clone the repo with submodules.
git clone --recursive git://github.com/nerfstudio-project/nerfacc/

Static NeRFs

See full benchmarking here: https://www.nerfacc.com/en/stable/examples/static.html

Instant-NGP on NeRF-Synthetic dataset with better performance in 4.5 minutes.

bash
# Occupancy Grid Estimator
python examples/train_ngp_nerf_occ.py --scene lego --data_root data/nerf_synthetic
# Proposal Net Estimator
python examples/train_ngp_nerf_prop.py --scene lego --data_root data/nerf_synthetic

Instant-NGP on Mip-NeRF 360 dataset with better performance in 5 minutes.

bash
# Occupancy Grid Estimator
python examples/train_ngp_nerf_occ.py --scene garden --data_root data/360_v2
# Proposal Net Estimator
python examples/train_ngp_nerf_prop.py --scene garden --data_root data/360_v2

Vanilla MLP NeRF on NeRF-Synthetic dataset in an hour.

bash
# Occupancy Grid Estimator
python examples/train_mlp_nerf.py --scene lego --data_root data/nerf_synthetic

TensoRF on Tanks&Temple and NeRF-Synthetic datasets (plugin in the official codebase).

bash
cd benchmarks/tensorf/
# (set up the environment for that repo)
bash script.sh nerfsyn-nerfacc-occgrid 0
bash script.sh tt-nerfacc-occgrid 0

Dynamic NeRFs

See full benchmarking here: https://www.nerfacc.com/en/stable/examples/dynamic.html

T-NeRF on D-NeRF dataset in an hour.

bash
# Occupancy Grid Estimator
python examples/train_mlp_tnerf.py --scene lego --data_root data/dnerf

K-Planes on D-NeRF dataset (plugin in the official codebase).

bash
cd benchmarks/kplanes/
# (set up the environment for that repo)
bash script.sh dnerf-nerfacc-occgrid 0

TiNeuVox on HyperNeRF and D-NeRF datasets (plugin in the official codebase).

bash
cd benchmarks/tineuvox/
# (set up the environment for that repo)
bash script.sh dnerf-nerfacc-occgrid 0
bash script.sh hypernerf-nerfacc-occgrid 0
bash script.sh hypernerf-nerfacc-propnet 0

Camera Optimization NeRFs

See full benchmarking here: https://www.nerfacc.com/en/stable/examples/camera.html

BARF on the NeRF-Synthetic dataset (plugin in the official codebase).

bash
cd benchmarks/barf/
# (set up the environment for that repo)
bash script.sh nerfsyn-nerfacc-occgrid 0

3rd-Party Usages:

Awesome Codebases.

  • nerfstudio: A collaboration friendly studio for NeRFs.
  • sdfstudio: A unified framework for surface reconstruction.
  • threestudio: A unified framework for 3D content creation.
  • instant-nsr-pl: NeuS in 10 minutes.
  • modelscope: A collection of deep-learning algorithms.

Awesome Papers.

  • Representing Volumetric Videos as Dynamic MLP Maps, CVPR 2023
  • NeRSemble: Multi-view Radiance Field Reconstruction of Human Heads, ArXiv 2023
  • HumanRF: High-Fidelity Neural Radiance Fields for Humans in Motion, ArXiv 2023

Common Installation Issues

ImportError: .../csrc.so: undefined symbol If you are installing a pre-built wheel, make sure the Pytorch and CUDA version matchs with the nerfacc version (nerfacc.__version__).

Citation

bibtex
@article{li2023nerfacc,
  title={NerfAcc: Efficient Sampling Accelerates NeRFs.},
  author={Li, Ruilong and Gao, Hang and Tancik, Matthew and Kanazawa, Angjoo},
  journal={arXiv preprint arXiv:2305.04966},
  year={2023}
}

Issues· 73 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythoninstant-ngpnerfpytorchrendering

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言