Project Page | Paper | Dataset
Nerfstudio requires python >= 3.8
. We recommend using conda to manage dependencies. Make sure to install Conda before proceeding.
conda create --name nerfemitter -y python=3.8
conda activate nerfemitter
pip install --upgrade pip
Install PyTorch with CUDA (this repo has been tested with CUDA 11.8) and tiny-cuda-nn.
cuda-toolkit
is required for building tiny-cuda-nn
.
For CUDA 11.8:
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
conda install -c "nvidia/label/cuda-11.8.0" -y cuda-toolkit
pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
git clone --recursive https://github.com/gerwang/nerf-emitter.git
cd nerf-emitter
pip install --upgrade pip setuptools
pip install -e .
conda install -y ffmpeg
imageio_download_bin freeimage
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo 'export PYTHONPATH=$PYTHONPATH:differentiable-sdf-rendering/python' > $CONDA_PREFIX/etc/conda/activate.d/setsdfpath.sh
conda deactivate
conda activate nerfemitter
Download the dataset from the release page and unzip to the project directory.
Please refer to the scripts/
directory for running the training, mesh export, novel-view synthesis and relighting.
bash scripts/synthetic/ours/run_${object}.sh
bash scripts/synthetic/baseline/run_${object}.sh
bash scripts/real/ours/run_${object}.sh
bash scripts/real/baseline/run_${object}.sh
differentiable-sdf-rendering/
contains our modified version of the differentiable SDF rendering codeassets/
contains the scene files for mitsuba3integrator_sdf.xml
is the configuration file for the mitsuba3 SDF renderersdf_scene.xml
is the scene file
python/
contains the emitter and integrator plugins for mitsuba3, written in Pythonemitters/
contains the emitter pluginsnerf.py
converts emitter queries to NeRF evaluationsnerf_emitter_op.py
wraps NeRF evaluation in PyTorch as adr.CustomOp
vMF.py
contains the implementation of the emitter importance sampling for NeRF
integrators/
contains the integrator pluginsreparam_split_light.py
is the base class which splits one rendering megakernel into twosdf_curvature.py
computes the curvature losssdf_direct_reparam_onesamplemis.py
is the main integrator
sensors/
contains the sensor pluginsspherical_sensor.py
can render a environment map
opt_configs.py
contains the configuration for the optimizationvariables.py
contains the optimization SDF and voxel grids
nerfstudio/
contains the NeRFStudio codeconfigs/
method_configs.py
contains the configuration forsdf-nerfacto
andsdf-gt-envmap
data/
datamanagers/
mitsuba_datamanager.py
loads images and mitsuba sensors for inverse rendering
dataparsers/
instant_ngp_dataparser.py
parses the synthetic datasetnerfstudio_dataparser.py
parses the real dataset
field_components/
rotater.py
handles the rotations of the turntable
model_coponents/
gmm_cluster_light.py
clusters the light point cloud into a Gaussian mixture modelmi_sensor_generators.py
converts NeRFStudio cameras to Mitsuba sensorsoutput_light_pc.py
uses sampled rays to obtain a NeRF point cloud
models/
nerfacto.py
is the modified nerf that supports HDR trainingsdf_nerfacto.py
supports batch checkpointing
path_guiding/
contains interfaces for importance samplingpath_guiding.py
is the base classvmf_guiding.py
implements the importance sampling using vMF mixtures
pipelines/
mitsuba_sdf.py
is the main pipeline for inverse rendering
scripts/
render.py
renders novel-view and relighted imagestrain.py
is the training script
This project is based on nerfstudio and differentiable-sdf-rendering. Thanks for these great projects.