← 开源
kwea123

nerf_pl

NeRF (Neural Radiance Fields) and NeRF in the Wild using pytorch-lightning

Model DevelopmentArchitectureJupyter Notebook
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
2.80k
Star
457
Fork
+0
本周
1
贡献者
创建于 2020-04-12 · 更新于 2026-10-02 · 今日第 8359 名
主要开发者

kwea123/nerf_pl 排名第 8,359,有 2,800 个星标。

同类别比较

kwea123/nerf_pl 排名第 8,359,此处有 8 个同类条目;unsplash/datasets 排名第 8,358。

同类别比较
名称排名指标
huawei-noah/HEBO8,350
语言:
Jupyter Notebook
星标数:
2,812
分叉数:
472
简介:
Bayesian optimisation & Reinforcement Learning library developed by Huawei Noah's Ark Lab
philipperemy/keras-attention8,353
语言:
Python
星标数:
2,809
分叉数:
646
简介:
Keras Attention Layer (Luong and Bahdanau scores).
pytorch/xla8,355
语言:
C++
星标数:
2,804
分叉数:
573
简介:
Enabling PyTorch on XLA Devices (e.g. Google TPU)
unsplash/datasets8,358
语言:
Jupyter Notebook
星标数:
2,801
分叉数:
141
简介:
🎁 7,400,000+ Unsplash images made available for research and machine learning
Alpha-VLLM/LLaMA2-Accessory8,362
语言:
Python
星标数:
2,796
分叉数:
174
简介:
An Open-source Toolkit for LLM Development
autodistill/autodistill8,368
语言:
Python
星标数:
2,790
分叉数:
227
简介:
Images to inference with no labeling (use foundation models to train supervised models).
tensorflow/graphics8,372
语言:
Python
星标数:
2,783
分叉数:
374
简介:
TensorFlow Graphics: Differentiable Graphics Layers for TensorFlow
wzhe06/SparrowRecSys8,373
语言:
Python
星标数:
2,781
分叉数:
866
简介:
A Deep Learning Recommender System
关键参数与规格
关键参数与规格
参数值
语言Jupyter Notebook
类别Model Development
子类别Architecture
关键词3D
星标数2,800
分叉数457
贡献者1
创建日期2020-04-12
更新日期2026-10-02
1 天星标数0
7 天星标数0
排名8,359
上次排名8,411
排名变化52
7 天星标排名11,958
上次 7 天星标排名12,010
7 天星标排名变化52
总星标排名4,826
上次总星标排名4,820
总星标排名变化-6
国家Taiwan
README 摘录

nerf_pl Update: NVIDIA open-sourced a lightning-fast version of NeRF: NGP. This version is ~100x faster than this repo with also better quality! Update: an improved NSFF implementation to handle dynamic scene is open! Update: NeRF-W (NeRF in the Wild) implementation is added to nerfw branch! Update: The lastest code (using the latest libraries) will be updated to dev branch. The master branch remains to support the colab files. If you don't use colab, it is recommended

to switch to dev branch. Only issues of the dev and nerfw branch will be considered currently. ) Unofficial implementation of NeRF (Neural Radiance Fields) using pytorch (pytorch-lightning). This repo doesn't aim at reproducibility, but aim at providing a simpler and faster training procedure (also simpler code with detailed comments to help to understand the work). Moreover, I try to extend much more opportunities by integrating this algorithm into game engine like Unity. Reference pytorch implementation: nerf-pytorch Recommend to

read: A detailed NeRF extension list: awesome-NeRF :milky_way: Features Multi-gpu training: Training on 8 GPUs finishes within 1 hour for the synthetic dataset! Portable Scenes to let you play with other people's scenes! You can find the Unity project including mesh, mixed reality and volume rendering here! See README_Unity for generating your own data for Unity rendering! Tutorial videos :computer: Installation Hardware OS: Ubuntu 18. 1** (tested with 1 RTX2080Ti) Software Clone this repo by Python

>=3. 6 (installation via anaconda is recommended, use to create a conda environment and activate it by ) Python libraries :key: Training Please see each subsection for training on different datasets. Available training datasets: Blender (Realistic Synthetic 360) LLFF (Real Forward-Facing) Your own data (Forward-Facing/360 inward-facing) Blender Steps Data download Download from here Training model Run (example) These parameters are chosen to best mimic the training settings in the original repo. NOTE: the above configuration doesn't work

for some scenes like , . In that case, consider increasing the or change the to . I managed to train on all scenes with these modifications. You can monitor the training process by and go to in your browser. LLFF Steps Data download Download from here Training model Run (example) These parameters are chosen to best mimic the training settings in the original repo. You can monitor the training process by and go to in your browser. Install COLMAP following installation guide

2. Prepare your images in a folder (around 20 to 30 for forward facing, and 40 to 50 for 360 inward-facing) 3. Train the model using the same command as in LLFF. If the scene is captured in a 360 inward-facing manner, add argument. For more details of training a good model, please see the video here. Pretrained models and logs Download the pretrained models and training logs in release. 12s | The speed is measured on 1 RTX2080Ti

. Detailed profile can be found in release. Training memory is largely reduced, since the original repo loads the whole data

常见问题

记录了多少星标和分叉?

kwea123/nerf_pl 有 2,800 个星标和 457 个分叉。

仓库排名是多少?

kwea123/nerf_pl 排名第 8,359。

记录的语言和类别是什么?

kwea123/nerf_pl 有 2,800 个星标,语言为 Jupyter Notebook,类别为 Model Development。

哪个仓库排名最接近?

kwea123/nerf_pl 与 unsplash/datasets 比较,后者排名第 8,358,有 2,801 个星标。

README

nerf_pl

Update: NVIDIA open-sourced a lightning-fast version of NeRF: NGP. I re-implemented in pytorch here. This version is ~100x faster than this repo with also better quality!

Update: an improved NSFF implementation to handle dynamic scene is open!

Update: NeRF-W (NeRF in the Wild) implementation is added to nerfw branch!

Update: The lastest code (using the latest libraries) will be updated to dev branch. The master branch remains to support the colab files. If you don't use colab, it is recommended to switch to dev branch. Only issues of the dev and nerfw branch will be considered currently.

:gem: Project page (live demo!)

Unofficial implementation of NeRF (Neural Radiance Fields) using pytorch (pytorch-lightning). This repo doesn't aim at reproducibility, but aim at providing a simpler and faster training procedure (also simpler code with detailed comments to help to understand the work). Moreover, I try to extend much more opportunities by integrating this algorithm into game engine like Unity.

Official implementation: nerf .. Reference pytorch implementation: nerf-pytorch

Recommend to read: A detailed NeRF extension list: awesome-NeRF

:milky_way: Features

You can find the Unity project including mesh, mixed reality and volume rendering here! See README_Unity for generating your own data for Unity rendering!

:beginner: Tutorial

What can NeRF do?

Tutorial videos

:computer: Installation

Hardware

  • OS: Ubuntu 18.04
  • NVIDIA GPU with CUDA>=10.1 (tested with 1 RTX2080Ti)

Software

  • Clone this repo by git clone --recursive https://github.com/kwea123/nerf_pl
  • Python>=3.6 (installation via anaconda is recommended, use conda create -n nerf_pl python=3.6 to create a conda environment and activate it by conda activate nerf_pl)
  • Python libraries
    • Install core requirements by pip install -r requirements.txt
    • Install torchsearchsorted by cd torchsearchsorted then pip install .

:key: Training

Please see each subsection for training on different datasets. Available training datasets:

Blender

Steps

Data download

Download nerf_synthetic.zip from here

Training model

Run (example)

python train.py \
   --dataset_name blender \
   --root_dir $BLENDER_DIR \
   --N_importance 64 --img_wh 400 400 --noise_std 0 \
   --num_epochs 16 --batch_size 1024 \
   --optimizer adam --lr 5e-4 \
   --lr_scheduler steplr --decay_step 2 4 8 --decay_gamma 0.5 \
   --exp_name exp

These parameters are chosen to best mimic the training settings in the original repo. See opt.py for all configurations.

NOTE: the above configuration doesn't work for some scenes like drums, ship. In that case, consider increasing the batch_size or change the optimizer to radam. I managed to train on all scenes with these modifications.

You can monitor the training process by tensorboard --logdir logs/ and go to localhost:6006 in your browser.

LLFF

Steps

Data download

Download nerf_llff_data.zip from here

Training model

Run (example)

python train.py \
   --dataset_name llff \
   --root_dir $LLFF_DIR \
   --N_importance 64 --img_wh 504 378 \
   --num_epochs 30 --batch_size 1024 \
   --optimizer adam --lr 5e-4 \
   --lr_scheduler steplr --decay_step 10 20 --decay_gamma 0.5 \
   --exp_name exp

These parameters are chosen to best mimic the training settings in the original repo. See opt.py for all configurations.

You can monitor the training process by tensorboard --logdir logs/ and go to localhost:6006 in your browser.

Your own data

Steps

  1. Install COLMAP following installation guide
  2. Prepare your images in a folder (around 20 to 30 for forward facing, and 40 to 50 for 360 inward-facing)
  3. Clone LLFF and run python img2poses.py $your-images-folder
  4. Train the model using the same command as in LLFF. If the scene is captured in a 360 inward-facing manner, add --spheric argument.

For more details of training a good model, please see the video here.

Pretrained models and logs

Download the pretrained models and training logs in release.

Comparison with other repos

training GPU memory in GB Speed (1 step)
Original 8.5 0.177s
Ref pytorch 6.0 0.147s
This repo 3.2 0.12s

The speed is measured on 1 RTX2080Ti. Detailed profile can be found in release. Training memory is largely reduced, since the original repo loads the whole data to GPU at the beginning, while we only pass batches to GPU every step.

:mag_right: Testing

See test.ipynb for a simple view synthesis and depth prediction on 1 image.

Use eval.py to create the whole sequence of moving views. E.g.

python eval.py \
   --root_dir $BLENDER \
   --dataset_name blender --scene_name lego \
   --img_wh 400 400 --N_importance 64 --ckpt_path $CKPT_PATH

IMPORTANT : Don't forget to add --spheric_poses if the model is trained under --spheric setting!

It will create folder results/{dataset_name}/{scene_name} and run inference on all test data, finally create a gif out of them.

Example of lego scene using pretrained model and the reconstructed colored mesh: (PSNR=31.39, paper=32.54)

Example of fern scene using pretrained model:

Example of own scene (Silica GGO figure) and the reconstructed colored mesh. Click to link to youtube video.

Portable scenes

The concept of NeRF is that the whole scene is compressed into a NeRF model, then we can render from any pose we want. To render from plausible poses, we can leverage the training poses; therefore, you can generate video with only the trained model and the poses (hence the name of portable scenes). I provided my silica model in release, feel free to play around with it!

If you trained some interesting scenes, you are also welcomed to share the model (and the poses_bounds.npy) by sending me an email, or post in issues! After all, a model is just around 5MB! Please run python utils/save_weights_only.py --ckpt_path $YOUR_MODEL_PATH to extract the final model.

:ribbon: Mesh

See README_mesh for reconstruction of colored mesh. Only supported for blender dataset and 360 inward-facing data!

:warning: Notes on differences with the original repo

  • The learning rate decay in the original repo is by step, which means it decreases every step, here I use learning rate decay by epoch, which means it changes only at the end of 1 epoch.
  • The validation image for LLFF dataset is chosen as the most centered image here, whereas the original repo chooses every 8th image.
  • The rendering spiral path is slightly different from the original repo (I use approximate values to simplify the code).

:mortar_board: COLAB

I also prepared colab notebooks that allow you to run the algorithm on any machine without GPU requirement.

  • colmap to prepare camera poses for your own training data
  • nerf to train on your data
  • extract_mesh to extract colored mesh

Please see this playlist for the detailed tutorials.

:jack_o_lantern: SHOWOFF

We can incorporate ray tracing techniques into the volume rendering pipeline, and realize realistic scene editing (following is the materials scene with an object removed, and a mesh is inserted and rendered with ray tracing). The code will not be released.

With my integration in Unity, I can realize realistic mixed reality photos (note my character casts shadow on the scene, zero post- image editing required): BTW, I would like to visit the museum one day...

:book: Citation

If you use (part of) my code or find my work helpful, please consider citing

@misc{queianchen_nerf,
  author={Quei-An, Chen},
  title={Nerf_pl: a pytorch-lightning implementation of NeRF},
  url={https://github.com/kwea123/nerf_pl/},
  year={2020},
}
排名相邻
同类项目