An object-oriented PyTorch implementation of NeRF (Neural Radiance Fields), encapsulated within classes: dataset, network, nerf_render, loss and trainer.
All configurations are set in config file: configs/*.yaml.
The code structure is inspired by stable-dreamfusion.
When I work on my NeRF-based projects, I found it a bit complex to customize and organize code blocks. For this concern, I refactor NeRF codes, encapsulated as classes, to facilitate latter usage.
*NeRF structures (aka backbones) to use:
- ✅ NeRF
- ☐ Voxel based NeRF
- ✅ Direct Voxel Grid Optimization (DVGO): Enhancement techniques were omitted for generalization, thus yielding results not as impressive as original paper.
- ☐ Instant Neural Graphics Primitives (Instant-ngp)
- ☐ Tri-plane NeRF (eg3d)
- ☐ Pixel NeRF
To download the datasets, refer to original NeRF data
python run.py --mode=train --config configs/lego.yaml
Initially introduced by DVGO and Plenoxels, and further popularized through instant-ngp, voxel-based NeRF has gained significant community interest due to its superior quality and impressive speed.

