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 pipInstall 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/torchgit 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 freeimagemkdir -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 nerfemitterDownload 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}.shbash scripts/synthetic/baseline/run_${object}.shbash scripts/real/ours/run_${object}.shbash scripts/real/baseline/run_${object}.shdifferentiable-sdf-rendering/contains our modified version of the differentiable SDF rendering codeassets/contains the scene files for mitsuba3integrator_sdf.xmlis the configuration file for the mitsuba3 SDF renderersdf_scene.xmlis the scene file
python/contains the emitter and integrator plugins for mitsuba3, written in Pythonemitters/contains the emitter pluginsnerf.pyconverts emitter queries to NeRF evaluationsnerf_emitter_op.pywraps NeRF evaluation in PyTorch as adr.CustomOpvMF.pycontains the implementation of the emitter importance sampling for NeRF
integrators/contains the integrator pluginsreparam_split_light.pyis the base class which splits one rendering megakernel into twosdf_curvature.pycomputes the curvature losssdf_direct_reparam_onesamplemis.pyis the main integrator
sensors/contains the sensor pluginsspherical_sensor.pycan render a environment map
opt_configs.pycontains the configuration for the optimizationvariables.pycontains the optimization SDF and voxel grids
nerfstudio/contains the NeRFStudio codeconfigs/method_configs.pycontains the configuration forsdf-nerfactoandsdf-gt-envmap
data/datamanagers/mitsuba_datamanager.pyloads images and mitsuba sensors for inverse rendering
dataparsers/instant_ngp_dataparser.pyparses the synthetic datasetnerfstudio_dataparser.pyparses the real dataset
field_components/rotater.pyhandles the rotations of the turntable
model_coponents/gmm_cluster_light.pyclusters the light point cloud into a Gaussian mixture modelmi_sensor_generators.pyconverts NeRFStudio cameras to Mitsuba sensorsoutput_light_pc.pyuses sampled rays to obtain a NeRF point cloud
models/nerfacto.pyis the modified nerf that supports HDR trainingsdf_nerfacto.pysupports batch checkpointing
path_guiding/contains interfaces for importance samplingpath_guiding.pyis the base classvmf_guiding.pyimplements the importance sampling using vMF mixtures
pipelines/mitsuba_sdf.pyis the main pipeline for inverse rendering
scripts/render.pyrenders novel-view and relighted imagestrain.pyis the training script
This project is based on nerfstudio and differentiable-sdf-rendering. Thanks for these great projects.
