GithubHelp home page GithubHelp logo

jryanshue / nfd Goto Github PK

View Code? Open in Web Editor NEW
269.0 23.0 10.0 39.54 MB

Official codebase for the paper "3D Neural Field Generation using Triplane Diffusion"

License: MIT License

Shell 0.25% Python 10.64% Cuda 0.67% C++ 0.09% Dockerfile 0.01% C 87.95% Makefile 0.04% HTML 0.22% CSS 0.03% Jupyter Notebook 0.01% Cython 0.10%

nfd's Introduction

NFD

This is the official codebase for the paper "3D Neural Field Generation using Triplane Diffusion."

Teaser image

Teaser image 2

Teaser image 3

3D Neural Field Generation using Triplane Diffusion
J. Ryan Shue*, Eric Ryan Chan*, Ryan Po*, Zachary Ankner*, Jiajun Wu, and Gordon Wetzstein
* equal contribution

https://jryanshue.com/nfd/

Abstract: Diffusion models have emerged as the state-of-the-art for image generation, among other tasks. Here, we present an efficient diffusion-based model for 3D-aware generation of neural fields. Our approach pre-processes training data, such as ShapeNet meshes, by converting them to continuous occupancy fields and factoring them into a set of axis-aligned triplane feature representations. Thus, our 3D training scenes are all represented by 2D feature planes, and we can directly train existing 2D diffusion models on these representations to generate 3D neural fields with high quality and diversity, outperforming alternative approaches to 3D-aware generation. Our approach requires essential modifications to existing triplane factorization pipelines to make the resulting features easy to learn for the diffusion model. We demonstrate state-of-the-art results on 3D generation on several object classes from ShapeNet.

Setup

Run:

cd nfd
conda env create -f environment.yml
conda activate nfd
pip install -e .

Download pretrained models:

source download_models.sh

Sampling from pretrained models

To run the models from our paper:

cd nfd
conda activate nfd

Cars:

python gen_samples.py --ddpm_ckpt models/cars/ddpm_cars_ckpts/ema_0.9999_405000.pt \
    --decoder_ckpt models/cars/car_decoder.pt --stats_dir models/cars/statistics/cars_triplanes_stats \
    --save_dir samples/cars_samples --num_samples 8 --num_steps 250 --shape_resolution 256

Chairs:

python gen_samples.py --ddpm_ckpt models/chairs/ddpm_chairs_ckpts/ema_0.9999_200000.pt \
    --decoder_ckpt models/chairs/chair_decoder.pt --stats_dir models/chairs/statistics/chairs_triplanes_stats \
    --save_dir samples/chairs_samples --num_samples 8 --num_steps 250 --shape_resolution 256

Planes:

python gen_samples.py --ddpm_ckpt models/planes/ddpm_planes_ckpts/ema_0.9999_220000.pt \
    --decoder_ckpt models/planes/plane_decoder.pt --stats_dir models/planes/statistics/planes_triplanes_stats \
    --save_dir samples/planes_samples --num_samples 8 --num_steps 250 --shape_resolution 256

Training

Coming soon!

nfd's People

Contributors

jryanshue avatar

Stargazers

 avatar Guiyong Zheng avatar chenjie avatar  avatar xxx avatar  avatar  avatar canbin avatar Xiong Lin avatar zhengjia avatar Qitong Yang avatar StriveZs avatar  avatar Hanyu Chen avatar Ziqiang Dang avatar Wensong HU avatar Ng Kam Woh avatar Divano avatar lpg avatar hoho avatar tjnuwjm avatar Mor avatar Haipeng Wang avatar MiZhenxing avatar Han Xu avatar TaeHoon Lee avatar  avatar Jinpeng Liu avatar  avatar Lihe Ding avatar Zhentao Liu avatar  avatar Maki Nishikino avatar  avatar Weichuang Li avatar Alakia avatar Haozheng Yu avatar Jiawei Lu avatar kal avatar  avatar Hu Zhu avatar Congrong Xu avatar Zhangshuai avatar yitongx avatar Ziwen Liu avatar steve avatar  avatar Yuchen Li avatar david l euler avatar Seul avatar jingli avatar hiyyg avatar Hyunsoo Cha avatar Duotun Wang avatar Pan avatar Haowen Sun avatar Zzzzz avatar  avatar Mr.wen avatar  avatar Zhe Zhu avatar ManGyu Gong avatar wangpu avatar cshen avatar  avatar Hyeongjun Heo avatar YangXiuyu avatar Fayeben avatar Mikle Mazurov avatar Zutao Jiang avatar yydxlv avatar  avatar Junzhe Jiang avatar  avatar Chenming Wu avatar 小白白学习 avatar xmu-xiaoma666 avatar Purva Tendulkar avatar  avatar Yiqun Lin avatar 愚人王 avatar wangm avatar JT5D avatar  avatar Jinguang Tong avatar  avatar  avatar yqdch avatar Jeff Carpenter avatar  avatar  avatar Woobin Im avatar  avatar hexarch avatar Guan Shanyan avatar Sang Min Kim avatar quanwei zhang avatar Jack Langerman avatar 王文琦 avatar Dr.AlexLiu avatar

Watchers

Bathsheba Grossman avatar  avatar  avatar  avatar Snow avatar  avatar Kostas Georgiou avatar Benoit Guillard avatar Pyjcsx avatar Zhongwen Rex Zhang avatar elucida avatar maturk avatar Suwoong Heo avatar HTYX avatar Alex Li avatar 小白白学习 avatar Junsheng Zhou avatar hiyyg avatar KIHONG KIM avatar  avatar Zexin He avatar  avatar  avatar

nfd's Issues

Dataset splits used in paper

The appendix of the paper mentions the size of the datasets used. 4045 for planes for eg. But there is no mention of the train/val/test splits. Was the diffusion model trained on all of the data?

How to train.

Thanks for sharing your great work!
Could you give a example or command to train the NDF. Could you have any advice? I notice that you have answered here for the training script.
Thanks a lot! I really would like to try training NDF.

gen_sample import

Hi,

Thank you sharing the pretrained weights for us!
When I try to run gen_sample.py as instructed, it seems that the line importing
"import neural_field_diffusion.scripts.image_sample as image_sample" takes very long and I wonder if it is the same case from your end?

Thanks in advance

Looking forward to code release

Nice work bringing diffusion models into 3D generation!

I am wondering when will you release your code? Do you have any plans?

Thanks!

small gradient when training

Hi~ thanks for the great work

I use trainable triplane and decoder to fitting objects. I use multi-view images instead of occupancy, and mse loss instead of BCE loss. The gradient for triplane seems too small , like 1e-4 even when I use 'sum' option in MSE loss.

Did you meet the same question? It's caused by little objects trained for decoder or other reasons?

Looking forward to your reply!!

pyrender.constants.RenderFlags.FACE_NORMALS flag while rendering images for FID calculation

Hi. Thanks for your great work!

I'm trying to compute FID score based on your codes of rendering fid images from given mesh.

Checking rendered images, I observed the rendered images looks like below.

14
4

And I found the normals are rendered because of the code below.
(Specifically, because of the flag pyrender.constants.RenderFlags.FACE_NORMALS)

https://github.com/JRyanShue/NFD/blob/main/nfd/neural_field_diffusion/metrics/render_utils.py#L183

What I want to ask is, why we need normals while computing FID scores.
Is it right to get the images as above and compute FID score with them?

Thanks

Training Code

Hi, thank you for your good job.

I plan to train your model on some other categories such as vessels. I wonder if you are still going to release the training code. I saw some discussion posted four months ago.

Thank you.

Visualizing triplane features

How did you visualize triplane features as in Fig. 7 (Ablation over regularized triplanes) of the paper? Was it just an average over the feature channel? Thanks!

About triplane

I notice that you use nn.embedding to represent triplane for multi-scene fitting , but nn.ParameterList for single-scene fitting, is there some reason for that such as save memory for multi-scene fitting?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.