• Stars
    star
    687
  • Rank 63,205 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 1 year ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Implementations of NeRF variants based on Taichi + PyTorch

Taichi NeRFs

A PyTorch + Taichi implementation of instant-ngp NeRF training pipeline. For more details about modeling, please checkout this article on our blog site.

Installation

  1. Install PyTorch by python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu116 (update the url with your installed CUDA Toolkit version number).
  2. Install taichi nightly via pip install -U pip && pip install -i https://pypi.taichi.graphics/simple/ taichi-nightly.
  3. Install requirements by pip install -r requirements.txt.
  4. If you plan to train with your own video, please install colmap via sudo apt install colmap or follow instructions at https://colmap.github.io/install.html.

Train with preprocessed datasets

Synthetic NeRF

Download Synthetic NeRF dataset and unzip it. Please keep the folder name unchanged.

We also provide a script to train the Lego scene from scratch, and display an interactive GUI at the end of the training.

./scripts/train_nsvf_lego.sh

Performance is measured on a Ubuntu 20.04 with an RTX3090 GPU.

Scene avg PSNR Training Time(20 epochs) GPU
Lego 35.0 208s RTX3090

To reach the best performance, here are the steps to follow:

  1. Your work station is running on Linux and has RTX 3090 Graphics card
  2. Follow the steps in Installation Section
  3. Uncomment --half2_opt to enable half2 optimization in the script, then ./scripts/train_nsvf_lego.sh. For now, half2 optimization is only supported on Linux with Graphics Card Architecture >Pascal.

360_v2 dataset

Download 360 v2 dataset and unzip it. Please keep the folder name unchanged. The default batch_size=8192 takes up to 18GB RAM on a RTX3090. Please adjust batch_size according to your hardware spec.

./scripts/train_360_v2_garden.sh

Train with your own video

Place your video in data folder and pass the video path to the script. There are several key parameters for producing a sound dataset for NeRF training. For a real scene, scale is recommended to set to 16. video_fps determines the number of images generated from the video, typically 150~200 images are sufficient. For a one minute video, 2 is a suitable number. Running this script will preprocess your video and start training a NeRF out of it:

./scripts/train_from_video.sh -v {your_video_name} -s {scale} -f {video_fps}

Mobile Deployment

Taichi NGP Deployment

Using Taichi AOT, you can easily deploy a NeRF rendering pipeline on any mobile devices!

We're able to achieve real-time interactive on iOS devices.

Performance iPad Pro (M1) iPhone 14 Pro Max iPhone 14
Taichi Instant NGP 22.4 fps 18 fps 13.5 fps

Stay tuned, more cool demos are on the way! For business inquiries, please reach out us at [email protected].

Text to 3D

Taichi-nerf serves as a new backend of the text-to-3D project stable-dreamfusion.

Frequently asked questions (FAQ)

Q: Is CUDA the only supported Taichi backend? How about vulkan backend?

A: For the most efficient interop with PyTorch CUDA backend, training is mostly tested with Taichi CUDA backend. However it's pretty straightforward to switch to Taichi vulkan backend if interop is removed, check out this awesome taichi-ngp inference demo!

Q: I got OOM(Out of Memory) error on my GPU, what can I do?

A: Reduce batch_size passed to train.py! By default it's 8192 which fits a RTX3090, you should reduce this accordingly. For instance, batch_size=2048 is recommended on a RTX3060Ti.

Acknowledgement

The PyTorch interface of the training pipeline and colmap preprocessing are highly referred to:

More Repositories

1

taichi

Productive, portable, and performant GPU programming in Python.
C++
24,605
star
2

difftaichi

10 differentiable physical simulators built with Taichi differentiable programming (DiffTaichi, ICLR 2020)
2,378
star
3

games201

Advanced Physics Engines 2020: A Hands-on Tutorial
Python
490
star
4

taichi_elements

High-performance multi-material continuum physics engine in Taichi
Python
454
star
5

awesome-taichi

A curated list of awesome Taichi applications, courses, demos and features.
322
star
6

taichi_three

A soft renderer based on Taichi (work in progress)
Python
216
star
7

voxel-challenge

Python
210
star
8

meshtaichi

MeshTaichi: A Compiler for Efficient Mesh-based Operations (SIGGRAPH Asia 2022)
Python
201
star
9

taichi_blend

Taichi Blender intergration for physics simulation and animation
Python
152
star
10

quantaichi

QuanTaichi evaluation suite
Python
134
star
11

taichi-docs-zh-cn

TaichiδΈ­ζ–‡ζ–‡ζ‘£
127
star
12

taichi_houdini

Python
101
star
13

faster-python-with-taichi

Python
76
star
14

taichicon

TaichiCon: Taichi Conferences
71
star
15

taichi_glsl

A Taichi extension library providing a set of GLSL-alike helper functions
Python
68
star
16

taichi-aot-demo

A demo illustrating how to use Taichi as an AOT shader compiler
C++
67
star
17

taichi.js

Run compiled Taichi kernels in JavaScript and WASM
Python
63
star
18

image-processing-with-taichi

Python
52
star
19

soft2d-release

Soft2D: A 2D multi-material continuum physics engine designed for real-time applications.
C++
48
star
20

Taichi-UnityExample

C#
46
star
21

cpp-training-season1

C++ training, season 1
C++
45
star
22

taichi_benchmark

Python
25
star
23

cheatsheet

TeX
24
star
24

taichi_dem

A minimal DEM simulation demo written in Taichi.
Python
24
star
25

docs.taichi.graphics

Home of the Taichi documentation site.
HTML
23
star
26

taichi-unity2

C++
20
star
27

cloth-simulation-homework

Python
16
star
28

community

13
star
29

advanced_examples

More advanced Taichi examples
Python
10
star
30

soft2d-for-unity

Soft2D-for-Unity
C#
10
star
31

poisson-sampling-homework

Python
9
star
32

sourceinspect

A unified inspector for retriving source from Python objects
Python
8
star
33

mls_mpm_88_extensions

Python
6
star
34

test_actions

C++
5
star
35

taichi_elements_blender_examples

5
star
36

public_files

5
star
37

dummy-rdp-client

Keep a live session by RDP, so OpenGL can function.
Rust
4
star
38

docstring-gen

Workflow for generating the docstring website
Python
4
star
39

mpm_3d_exercise

Python
4
star
40

stock_trading_strategy

Optimal stock trading strategy using Taichi
Python
3
star
41

taitopia-status-page

Taitopia status page
Markdown
3
star
42

taichi_assets

Taichi binary assets (submodule of the main Taichi repository)
3
star
43

taichi-release-tests

Python
2
star
44

blogs

Python
2
star
45

taichi-zoo-issue-tracker

This repository is used for collecting user feedback from the community
1
star
46

hackathons

Taichi ❀️ Hackathons
1
star
47

taichi_glad_ready

Ready to use GLAD as a OpenGL API loader
C
1
star