A reimplementation of mip-NeRF in PyTorch.
Not exactly 1-to-1 with the official repo, as we organized the code to out own liking (mostly how the datasets are structued, and hyperparam changes to run the code on a consumer level graphics card), made it more modular, and removed some repetitive code, but it achieves the same results.
In the future we plan on implementing/changing:
mipNeRF.yml
bash scripts/download_data.sh
to download all 3 datasets: LLFF, Blender, and Multicam.bash scripts/download_llff.sh
to download LLFFbash scripts/download_blender.sh
to download Blenderbash scripts/download_multicam.sh
to download Multicam (Note this will also download the blender dataset since it's derived from it)config.py
or specify with command line arguments
python train.py
to train
python -m tensorboard.main --logdir=log
to start the tensorboardpython visualize.py
to render a video from the trained modelpython extract_mesh.py
to render a mesh from the trained modelI explain the specifics of the code more in detail here but here is a basic rundown.
config.py
: Specifies hyperparameters.datasets.py
: Base generic Dataset
class + 3 default dataset implementations.
NeRFDataset
: Base class that all datasets should inherent from.Multicam
: Used for multicam data as in the original mip-NeRF paper.Blender
: Used for the synthetic dataset as in original NeRF.LLFF
: Used for the llff dataset as in the original NeRF.loss.py
: mip-NeRF loss, pretty much just MSE, but also calculates psnr.model.py
: mip-NeRF model, not as modular as the way the original authors wrote it, but easier to understand its structure when laid out verbatim like this.pose_utils.py
: Various functions used to generate poses.ray_utils.py
: Various functions related involving rays that the model uses as input, most are used within the forward function of the model.scheduler.py
: mip-NeRF learning rate scheduler.train.py
: Trains a mip-NeRF model.visualize.py
: Creates the videos using a trained mip-NeRF.Here's a summary on how NeRF and mip-NeRF work that I wrote when writing this originally.
All PSNRs are average PSNR (coarse + fine).
Video:
Depth:
Normals:
Video:
Depth:
Normals:
Video:
Depth:
Normals: