How jeremyhaow/s2nerf works
This repository is a NeRF training and rendering application with custom CUDA-backed encoders and ray marching. The main workflow loads a scene dataset, constructs a NeRF model and trainer, trains, then evaluates, renders video, and exports a mesh. The README provides no capability detail, so this map reflects the sampled entry point and source references; unsampled subsystem behavior and connections are not inferred.
Main entry points: network.py NeRF network · main_nerf.py Experiment entry · encoding.py Encoding selection · provider.py Scene dataset
Components 18
NeRF application
- Experiment entry
main_nerf.py - Scene dataset
nerf/provider.py - Ray generation
nerf/utils.py - NeRF network
nerf/network.py - Training and evaluation
nerf/trainer.py - Loss functions
loss.py - Gradient activations
activation.py
Feature encoders
- Encoding selection
encoding.py - Grid encoding
gridencoder/grid.py - Frequency encoding
freqencoder/freq.py - Spherical harmonics
shencoder/sphere_harmonics.py
Ray rendering
- Volume renderer
nerf/renderer.py - Ray marching operations
raymarching/raymarching.py
CUDA backends
- Grid CUDA kernels
gridencoder/src/gridencoder.h - Frequency CUDA backend
freqencoder/src/freqencoder.h - SH CUDA backend
shencoder/src/shencoder.h - Ray-marching CUDA kernels
raymarching/src/raymarching.h
Other components
- CLI user
Connections 16
- CLI user → Experiment entry: configures and runs
main_nerf.py - Experiment entry → Scene dataset: constructs loaders
main_nerf.py - Experiment entry → NeRF network: constructs
main_nerf.py - Experiment entry → Training and evaluation: starts training
main_nerf.py - Scene dataset → Ray generation: uses ray utilities
nerf/provider.py - Training and evaluation → NeRF network: renders predictions
nerf/trainer.py - NeRF network → Gradient activations: uses
nerf/network.py - NeRF network → Encoding selection: uses encodings
nerf/network.py - NeRF network → Volume renderer: uses renderer
nerf/network.py - Encoding selection → Grid encoding: selects
encoding.py - Encoding selection → Spherical harmonics: selects
encoding.py - Grid encoding → Grid CUDA kernels: dispatches kernels
gridencoder/grid.py - Frequency encoding → Frequency CUDA backend: dispatches kernels
freqencoder/freq.py - Spherical harmonics → SH CUDA backend: dispatches kernels
shencoder/sphere_harmonics.py - Volume renderer → Ray marching operations: uses ray operations
nerf/renderer.py - Ray marching operations → Ray-marching CUDA kernels: dispatches kernels
raymarching/raymarching.py