NIRVANALAN commited on
Commit
11e6f7b
1 Parent(s): 02553f6
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +2 -0
  2. LICENSE +10 -0
  3. README.md +387 -10
  4. __pycache__/gradio_app.cpython-310.pyc +0 -0
  5. assets/ffhq_eval_pose.pt +3 -0
  6. assets/i23d/single-img-cond/birthday-cake.gif +3 -0
  7. assets/i23d/single-img-cond/chest.gif +3 -0
  8. assets/i23d/single-img-cond/flower.gif +3 -0
  9. assets/i23d/single-img-cond/genshin-house.gif +3 -0
  10. assets/i23d/single-img-cond/robot.gif +3 -0
  11. assets/i23d_examples/for_demo_inference/fox-input.png +0 -0
  12. assets/i23d_examples/for_demo_inference/genshin_building-input.png +0 -0
  13. assets/i23d_examples/for_demo_inference/sword-input.png +0 -0
  14. assets/i23d_examples/for_demo_inference/teasure_chest-input.png +0 -0
  15. assets/i23d_examples/instant_mesh_samples/bulldog-input.png +0 -0
  16. assets/i23d_examples/instant_mesh_samples/cake-input.png +0 -0
  17. assets/i23d_examples/instant_mesh_samples/cute_tiger-input.png +0 -0
  18. assets/i23d_examples/instant_mesh_samples/extinguisher-input.png +0 -0
  19. assets/i23d_examples/instant_mesh_samples/genshin_teapot-input.png +0 -0
  20. assets/i23d_examples/instant_mesh_samples/house2-input.png +0 -0
  21. assets/i23d_examples/instant_mesh_samples/mushroom_teapot-input.png +0 -0
  22. assets/i23d_examples/instant_mesh_samples/plant-input.png +0 -0
  23. assets/i23d_examples/instant_mesh_samples/robot-input.png +0 -0
  24. assets/i23d_examples/instant_mesh_samples/sorting_board-input.png +0 -0
  25. assets/input_cameras.pt +3 -0
  26. assets/objv_eval_pose.pt +3 -0
  27. assets/render_cameras.pt +3 -0
  28. assets/shapenet_eval_pose.pt +3 -0
  29. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000.json +47 -0
  30. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000.png +0 -0
  31. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_albedo.png +0 -0
  32. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_hdr.exr +0 -0
  33. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_mr.png +0 -0
  34. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_nd.exr +0 -0
  35. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_ng.exr +0 -0
  36. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001.json +47 -0
  37. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001.png +0 -0
  38. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_albedo.png +0 -0
  39. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_hdr.exr +0 -0
  40. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_mr.png +0 -0
  41. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_nd.exr +0 -0
  42. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_ng.exr +0 -0
  43. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002.json +47 -0
  44. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002.png +0 -0
  45. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_albedo.png +0 -0
  46. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_hdr.exr +0 -0
  47. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_mr.png +0 -0
  48. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_nd.exr +0 -0
  49. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_ng.exr +0 -0
  50. assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00003/00003.json +47 -0
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.ply filter=lfs diff=lfs merge=lfs -text
37
+ *.gif filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ S-Lab License 1.0
2
+
3
+ Copyright 2023 S-Lab
4
+
5
+ Redistribution and use for non-commercial purpose in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10
+ 4. In the event that redistribution and/or use for commercial purpose in source or binary forms, with or without modification is required, please contact the contributor(s) of the work.
README.md CHANGED
@@ -1,12 +1,389 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
- title: LN3Diff I23D ECCV24
3
- emoji: 👀
4
- colorFrom: blue
5
- colorTo: red
6
- sdk: gradio
7
- sdk_version: 4.41.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div align="center">
2
+
3
+ <h1>
4
+ LN3Diff: Scalable Latent Neural Fields Diffusion for Speedy 3D Generation (ECCV 2024)
5
+ </h1>
6
+
7
+ <div>
8
+ <a href='https://github.com/NIRVANALAN' target='_blank'>Yushi Lan</a><sup>1</sup>&emsp;
9
+ <a href='https://hongfz16.github.io' target='_blank'>Fangzhou Hong</a><sup>1</sup>&emsp;
10
+ <a href='https://williamyang1991.github.io/' target='_blank'>Shuai Yang</a><sup>2</sup>&emsp;
11
+ <a href='https://shangchenzhou.com/' target='_blank'>Shangchen Zhou</a><sup>1</sup>&emsp;
12
+ <a href='https://sg.linkedin.com/in/xuyi-meng-673779208' target='_blank'>Xuyi Meng</a><sup>1</sup>&emsp;
13
+ <br>
14
+ <a href='https://daibo.info/' target='_blank'>Bo Dai</a>
15
+ <sup>3</sup>
16
+ <a href='https://xingangpan.github.io/' target='_blank'>Xingang Pan</a>
17
+ <sup>1</sup>
18
+ <a href='https://www.mmlab-ntu.com/person/ccloy/' target='_blank'>Chen Change Loy</a>
19
+ <sup>1</sup> &emsp;
20
+ </div>
21
+ <div>
22
+ S-Lab, Nanyang Technological University<sup>1</sup>;
23
+ <!-- &emsp; -->
24
+ <br>
25
+ Wangxuan Institute of Computer Technology, Peking University<sup>2</sup>;
26
+ <br>
27
+ <!-- &emsp; -->
28
+ Shanghai Artificial Intelligence Laboratory <sup>3</sup>
29
+ <!-- <br>
30
+ <sup>*</sup>corresponding author -->
31
+ </div>
32
+
33
+ <div>
34
+ <!-- <a target="_blank" href="https://colab.research.google.com/github/nirvanalan/E3DGE/blob/main/notebook/CVPR23_E3DGE_Demo.ipynb">
35
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
36
+ </a> -->
37
+ <a href="https://hits.seeyoufarm.com"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FNIRVANALAN%2FLN3Diff&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false"/></a>
38
+ </div>
39
+ <br>
40
+ <!-- <h4> -->
41
+ <strong>
42
+ LN3Diff (Latent Neural Fields 3D Diffusion) is a generic, feedforward 3D LDM framework that creates high-quality 3D object mesh from text within SECONDS.
43
+ </strong>
44
+ <!-- </h4> -->
45
+
46
+ <!-- <table>
47
+ <tr></tr>
48
+ <tr>
49
+ <td>
50
+ <img src="assets/t23d/standing-hund.gif">
51
+ </td>
52
+ <td>
53
+ <img src="assets/t23d/ufo.gif">
54
+ </td>
55
+ <td>
56
+ <img src="assets/t23d/mast.gif">
57
+ </td>
58
+ <td>
59
+ <img src="assets/t23d/cannon.gif">
60
+ </td>
61
+ <td>
62
+ <img src="assets/t23d/blue-plastic-chair.gif">
63
+ </td>
64
+ </tr>
65
+
66
+
67
+
68
+ <tr>
69
+ <td align='center' width='20%'>A standing hund.</td>
70
+ <td align='center' width='20%'>An UFO space aircraft.</td>
71
+ <td align='center' width='20%'>A sailboat with mast.</td>
72
+ <td align='center' width='20%'>An 18th century cannon.</td>
73
+ <td align='center' width='20%'>A blue plastic chair.</td>
74
+ </tr>
75
+ <tr></tr>
76
+ </table> -->
77
+
78
+ <table>
79
+ <tr></tr>
80
+ <tr>
81
+ <td>
82
+ <img src="assets/t23d/dit-l2/the-eiffel-tower.gif">
83
+ </td>
84
+ <td>
85
+ <img src="assets/t23d/dit-l2/stone-waterfall-with-wooden-shed.gif">
86
+ </td>
87
+ <td>
88
+ <img src="assets/t23d/dit-l2/a-plate-of-sushi.gif">
89
+ </td>
90
+ <td>
91
+ <img src="assets/t23d/dit-l2/wooden-chest-with-golden-trim.gif">
92
+ </td>
93
+ <td>
94
+ <img src="assets/t23d/dit-l2/a-blue-plastic-chair.gif">
95
+ </td>
96
+ </tr>
97
+
98
+
99
+ <tr>
100
+ <td align='center' width='20%'>The eiffel tower.</td>
101
+ <td align='center' width='20%'>A stone waterfall with wooden shed.</td>
102
+ <td align='center' width='20%'>A plate of sushi</td>
103
+ <td align='center' width='20%'>A wooden chest with golden trim</td>
104
+ <td align='center' width='20%'>A blue plastic chair.</td>
105
+ </tr>
106
+ <tr></tr>
107
+ </table>
108
+
109
+ <!-- <br> -->
110
+
111
+ For more visual results, go checkout our <a href="https://nirvanalan.github.io/projects/ln3diff/" target="_blank">project page</a> :page_with_curl:
112
+
113
+ <strike>
114
+ Codes coming soon :facepunch:
115
+ </strike>
116
+
117
+ This repository contains the official implementation of LN3Diff:
118
+ Scalable Latent Neural Fields Diffusion for Speedy 3D Generation
119
+
120
+ </div>
121
+
122
  ---
 
 
 
 
 
 
 
 
 
123
 
124
+ <h4 align="center">
125
+ <a href="https://nirvanalan.github.io/projects/ln3diff/" target='_blank'>[Project Page]</a>
126
+
127
+ <a href="https://arxiv.org/pdf/2403.12019.pdf" target='_blank'>[arXiv]</a>
128
+ </h4>
129
+
130
+
131
+ ## :mega: Updates
132
+
133
+ [08/2024] We have released the new 3D VAE trained on G-Objaverse full sets, and the corresponding DiT-based T23D and I23D model, trained with flow-matching. Please check the samples below.
134
+
135
+ [06/2024] LN3Diff got accepted to ECCV 2024 :partying_face:!
136
+
137
+ [04/2024] Inference and training codes on Objaverse, ShapeNet and FFHQ are released, including pre-trained model and training dataset.
138
+
139
+ [03/2024] Initial code release.
140
+
141
+
142
+ ## :dromedary_camel: TODO
143
+
144
+ - [ ] Add Gradio demo.
145
+ - [x] Release the new I23D flow-matching-based DiT model trained with 180K G-Objaverse instances (Aug 2024).
146
+ - [x] Release the new T23D DDPM-based DiT model trained with 180K G-Objaverse instances (Aug 2024).
147
+ - [x] Release the new 3D VAE trained with 180K G-Objaverse instances (July 2024).
148
+ - [x] Release DiT-based, flow-matching based 3D generation framework (July 2024).
149
+ - [ ] Polish the dataset preparation and training doc.
150
+ - [ ] add metrics evaluation scripts and samples.
151
+ - [ ] Lint the code.
152
+ - [x] Release the inference and training code (Apr 2024).
153
+ - [x] Release the pre-trained checkpoints of ShapeNet and FFHQ (Apr 2024).
154
+ - [x] Release the pre-trained checkpoints of T23D Objaverse model trained with 30K+ instances dataset (Apr 2024).
155
+ - [x] Release the stage-1 VAE of Objaverse trained with 80K+ instances dataset (Apr 2024).
156
+
157
+
158
+
159
+ ## :handshake: Citation
160
+ If you find our work useful for your research, please consider citing the paper:
161
+ ```
162
+ @inproceedings{lan2024ln3diff,
163
+ title={LN3Diff: Scalable Latent Neural Fields Diffusion for Speedy 3D Generation},
164
+ author={Yushi Lan and Fangzhou Hong and Shuai Yang and Shangchen Zhou and Xuyi Meng and Bo Dai and Xingang Pan and Chen Change Loy},
165
+ year={2024},
166
+ booktitle={ECCV},
167
+ }
168
+ ```
169
+
170
+ ## :desktop_computer: Requirements
171
+
172
+ NVIDIA GPUs are required for this project.
173
+ We conduct all the training on NVIDIA V100-32GiB (ShapeNet, FFHQ) and NVIDIA A100-80GiB (G-Objaverse).
174
+ We have test the inference codes on NVIDIA V100.
175
+ We recommend using anaconda to manage the python environments.
176
+
177
+ The environment can be created via ```conda env create -f environment_ln3diff.yml```, and activated via ```conda activate ln3diff```.
178
+ If you want to reuse your own PyTorch environment, install the following packages in your environment:
179
+
180
+ ```
181
+ pip install -r requirements.txt
182
+ ```
183
+
184
+ ## :running_woman: Inference
185
+
186
+ ### Download Models
187
+
188
+ The pretrained stage-1 VAE and stage-2 LDM can be downloaded via [OneDrive](https://entuedu-my.sharepoint.com/:u:/g/personal/yushi001_e_ntu_edu_sg/EdOR7CbhyndFryaDnlexFqwBIr9XzFgdKXoLOOIagt7Ggw?e=ZzULnq).
189
+
190
+ Put the downloaded checkpoints under ```checkpoints``` folder for inference. The checkpoints directory layout should be
191
+
192
+ checkpoints
193
+ ├── objaverse
194
+ │ ├── model_rec1890000.pt # DiT/L-based 3D VAE
195
+ │ └── objaverse-dit
196
+ │ └── t23d/model_joint_denoise_rec_model3820000.pt #
197
+ │ └── i23d/model_joint_denoise_rec_model2990000.pt #
198
+ ├── shapenet
199
+ │ └── car
200
+ │ └── model_joint_denoise_rec_model1580000.pt
201
+ │ └── chair
202
+ │ └── model_joint_denoise_rec_model2030000.pt
203
+ │ └── plane
204
+ │ └── model_joint_denoise_rec_model770000.pt
205
+ ├── ffhq
206
+ │ └── objaverse-vae/model_joint_denoise_rec_model1580000.pt
207
+ └── ...
208
+
209
+
210
+
211
+ ### Inference Commands
212
+
213
+ <strong>Note that to extract the mesh, 24GiB VRAM is required.</strong>
214
+
215
+ ## (New) Inference: (Single) Image-to-3D
216
+
217
+ We train a single-image-conditioned DiT-L/2 on the extracted VAE latents using [flow-matching](https://github.com/willisma/SiT]) framework, for more controllable 3D generation. To inference the results, please run
218
+
219
+ ```bash
220
+ bash shell_scripts/final_release/inference/sample_obajverse_i23d_dit.sh
221
+ ```
222
+
223
+ Which reconstructs the 3D assets given input images from ```assets/i23d_examples/for_demo_inference```. The input images are borrowed from [InstantMesh](https://github.com/TencentARC/InstantMesh). The model outputs are shown below (input in the next row.):
224
+
225
+ <table>
226
+ <tr></tr>
227
+ <tr>
228
+ <td>
229
+ <img src="assets/i23d/single-img-cond/genshin-house.gif">
230
+ </td>
231
+ <td>
232
+ <img src="assets/i23d/single-img-cond/chest.gif">
233
+ </td>
234
+ <td>
235
+ <img src="assets/i23d/single-img-cond/flower.gif">
236
+ </td>
237
+ <td>
238
+ <img src="assets/i23d/single-img-cond/robot.gif">
239
+ </td>
240
+ <td>
241
+ <img src="assets/i23d/single-img-cond/birthday-cake.gif">
242
+ </td>
243
+ <!-- <td>
244
+ <img src="assets/i23d/single-img-cond/birthday-cake.gif">
245
+ </td> -->
246
+ </tr>
247
+
248
+ To run 3D reconstruction with your own data, just change the ```$eval_path``` in the above bash file. E.g., change it to ```eval_path=./assets/i23d_examples/instant_mesh_samples``` will do 3D reconstruction on more real images from InstantMesh.
249
+ Also, tuning the cfg through ```$unconditional_guidance_scale``` will balance the generation fidelity and diversity.
250
+
251
+
252
+ <tr>
253
+ <td align='center' width='20%'>
254
+ <img src="assets/i23d_examples/for_demo_inference/genshin_building-input.png">
255
+ </td>
256
+ <td align='center' width='20%'>
257
+ <img src="assets/i23d_examples/for_demo_inference/teasure_chest-input.png">
258
+ </td>
259
+ <td align='center' width='20%'>
260
+ <img src="assets/i23d_examples/instant_mesh_samples/plant-input.png">
261
+ </td>
262
+ <td align='center' width='20%'>
263
+ <img src="assets/i23d_examples/instant_mesh_samples/robot-input.png">
264
+ </td>
265
+ <td align='center' width='20%'>
266
+ <img src="assets/i23d_examples/instant_mesh_samples/cake-input.png">
267
+ </td>
268
+ <!-- <td align='center' width='20%'>
269
+ <img src="assets/i23d_examples/for_demo_inference/sword-input.png">
270
+ </td> -->
271
+ </tr>
272
+ <tr></tr>
273
+ </table>
274
+
275
+ We have uploaded the inference results on some common I23D images (from InstantMesh) to [onedrive](https://entuedu-my.sharepoint.com/:u:/g/personal/yushi001_e_ntu_edu_sg/EeMmXvoJ0khNjzWLgMBEgMMB_xb9r9ciRkDgjnQCDJqLSg?e=rk9iGs), including the condition images, rendered images/videos and the corresponding extracted textured mesh (with 4 different seeds, and cfg=5.0). Feel free to use them for comparison in your own method.
276
+
277
+ ## Inference: Text-to-3D
278
+
279
+ We train text-conditioned 3D latent diffusion model on top of the stage-1 extracted latents.
280
+ For the following bash inference file, to extract textured mesh from the generated tri-plane, set ```--save_img True```. To change the text prompt, set the ```prompt``` variable. For unconditional sampling, set the cfg guidance ```unconditional_guidance_scale=0```. Feel free to tune the cfg guidance scale to trade off diversity and fidelity.
281
+
282
+ Note that the diffusion sampling batch size is set to ```4```, which costs around 16GiB VRAM. The mesh extraction of a single instance costs 24GiB VRAM.
283
+
284
+ ### text-to-3D on Objaverse
285
+
286
+ ```bash
287
+ bash shell_scripts/final_release/inference/sample_obajverse_t23d_dit.sh
288
+ ```
289
+ which shall reproduce the results shown in the Fig.5 in our paper, using the same text prompts. The results may slightly differ due to random seed used, but the quality are the same. Some output samples are shown in the top figure.
290
+
291
+
292
+ Note that the text prompts are directly hard-coded in the ```scripts/vit_triplane_diffusion_sample_objaverse.py```.
293
+
294
+ ### text-to-3D on ShapeNet
295
+
296
+ For text-to-3D on ShapeNet, run one of the following commands (which conducts T23D on car, chair and plane.)
297
+ ```bash
298
+ bash shell_scripts/final_release/inference/sample_shapenet_car_t23d.sh
299
+ ```
300
+
301
+ ```bash
302
+ bash shell_scripts/final_release/inference/sample_shapenet_chair_t23d.sh
303
+ ```
304
+
305
+ ```bash
306
+ bash shell_scripts/final_release/inference/sample_shapenet_plane_t23d.sh
307
+ ```
308
+
309
+ The output samples for FID, COV/MMD calculation are uploaded [here](https://entuedu-my.sharepoint.com/:f:/g/personal/yushi001_e_ntu_edu_sg/Euc7VaM3SH9EmaJuwC0dG9cBWgyLQY6gsiogGMO4NB-ebA?e=fGh2Rv), which shall reproduce the quantitative results in Tab. 1 in the paper.
310
+
311
+
312
+ ### text-to-3D on FFHQ
313
+ For text-to-3D on FFHQ, run
314
+
315
+ ```bash
316
+ bash shell_scripts/final_release/inference/sample_ffhq_t23d.sh
317
+ ```
318
+
319
+ #### Stage-1 VAE 3D reconstruction
320
+
321
+ For (Objaverse) stage-1 VAE 3D reconstruction and extract VAE latents for diffusion learning, please run
322
+
323
+ ```bash
324
+ bash shell_scripts/final_release/inference/sample_obajverse.sh
325
+ ```
326
+
327
+ which shall give the following result:
328
+
329
+ ![Alt Text](assets/stage1_vae_reconstruction/reconstruction_result/stage1-vae-reconstruction.gif)
330
+
331
+ The marching-cube extracted mesh can be visualized with Blender/MeshLab:
332
+
333
+ <img title="a title" alt="Mesh Visualization" src="./assets/stage1_vae_reconstruction/reconstruction_result/mesh-visualization.png">
334
+
335
+ The above VAE input and reconstruction outputs can be found in the [assets/stage1_vae_reconstruction](./assets/stage1_vae_reconstruction) folder.
336
+
337
+ **!! We upload the pre-extracted vae latents [here](https://entuedu-my.sharepoint.com/:u:/g/personal/yushi001_e_ntu_edu_sg/Ef_7iMZRQT5Bl5YI0hHabQ0B_Y8INDDuaq78gOJaQSPiqg?e=Ef3rXK), which contains the correponding VAE latents (with shape 32x32x12) of 176K G-buffer Objaverse objects. Feel free to use them in your own task.**
338
+
339
+ For more G-buffer Objaverse examples, download the [demo data](https://entuedu-my.sharepoint.com/:f:/g/personal/yushi001_e_ntu_edu_sg/EoyzVJbMyBhLoKFJbbsq6bYBi1paLwQxIDjTkO1KjI4b1g?e=sJc3rQ).
340
+
341
+
342
+
343
+
344
+ ## :running_woman: Training
345
+
346
+
347
+ ### For training stage-1 VAE
348
+
349
+ For Objaverse, we use the rendering provided by [G-buffer Objaverse](https://aigc3d.github.io/gobjaverse/).
350
+ We process the data into multi-view chunks for faster loading, and the pre-processed data (176K instances) can be downloaded [here](https://entuedu-my.sharepoint.com/:f:/g/personal/yushi001_e_ntu_edu_sg/EtOUTVZNtGxCg3aJnCDkqZcBmH_-OxCGLQBDwqq9ny5Ing?e=BUHiZi). Noted that you need 450 GiB storage to download the dataset.
351
+
352
+ <!-- A demo subset for stage-1 VAE reconstruction can be downloaded from [here](https://entuedu-my.sharepoint.com/:u:/g/personal/yushi001_e_ntu_edu_sg/Eb6LX2x-EgJLpiHbhRxsN9ABnEaSyjG-tsVBcUr_dQ5dnQ?e=JXWQo1). Note that for Objaverse training, we pre-process the raw data into [wds-dataset](https://github.com/webdataset/webdataset) shards for fast and flexible loading. The sample shard data can be found in [here](https://entuedu-my.sharepoint.com/:f:/g/personal/yushi001_e_ntu_edu_sg/ErtZQgnEH5ZItDqdUaiVbJgBe4nhZveJemQRqDW6Xwp7Zg?e=Zqt6Ss). -->
353
+
354
+ For ShapeNet, we render our own data with foreground mask for training, which can be downloaded from [here](https://entuedu-my.sharepoint.com/:f:/g/personal/yushi001_e_ntu_edu_sg/EijBXIC_bUNOo0L3wnJKRqoBCqVnhhT_BReYRc1tc_0lrA?e=VQwWOZ). For training, we convert the raw data to LMDB for faster data loading. The pre-processed LMDB file can be downloaded from [here](https://entuedu-my.sharepoint.com/:f:/g/personal/yushi001_e_ntu_edu_sg/Ev7L8Als8K9JtLtj1G23Cc0BTNDbhCQPadxNLLVS7mV2FQ?e=C5woyE).
355
+
356
+
357
+ For FFHQ, we use the pre-processed dataset from [EG3D](https://github.com/NVlabs/eg3d) and compress it into LMDB, which can also be found in the onedrive link above.
358
+
359
+ ### For training stage-2 LDM
360
+
361
+ #### Pre-extracted latents
362
+
363
+ We have uploaded the pre-extracted vae latents [here](https://entuedu-my.sharepoint.com/:u:/g/personal/yushi001_e_ntu_edu_sg/Ef_7iMZRQT5Bl5YI0hHabQ0B_Y8INDDuaq78gOJaQSPiqg?e=Ef3rXK), which contains the correponding VAE latents (with shape 32x32x3x4) of 176K G-buffer Objaverse objects. Feel free to use them in the LDM training.
364
+
365
+ #### text-to-3D
366
+ The Cap3D captions can be downloaded from [here](https://entuedu-my.sharepoint.com/:u:/g/personal/yushi001_e_ntu_edu_sg/EdzVtlT_eUpItE73osqE1UEBSNmC2wfQ0YimmMcLcRhpqw?e=wMHtvx).
367
+ Please put under ```'./datasets/text_captions_cap3d.json'```
368
+
369
+ #### image-to-3D
370
+ We directly use G-Objaverse rendering images for training, and you may need to download their data for this experiments.
371
+
372
+
373
+ ### Training Commands
374
+
375
+ Coming soon.
376
+
377
+ ## More discussions of the proposed method
378
+ Compared to existing 3D generation framework such as SDS-based ([DreamFusion](https://dreamfusion3d.github.io/)), mulit-view generation-based ([MVDream](https://arxiv.org/abs/2308.16512), [Zero123++](https://github.com/SUDO-AI-3D/zero123plus), [Instant3D](https://instant-3d.github.io/)) and feedforward 3D reconstruction-based ([LRM](https://yiconghong.me/LRM/), [InstantMesh](https://github.com/TencentARC/InstantMesh), [LGM](https://github.com/3DTopia/LGM)), LN3Diff is an origin 3D Diffusion framework.
379
+ Like 2D/Video AIGC pipeline, LN3Diff first trains a 3D-VAE and then conduct LDM training (text/image conditioned) on the learned latent space. Some related methods from the industry ([Shape-E](https://github.com/openai/shap-e), [CLAY](https://github.com/CLAY-3D/OpenCLAY), [Meta 3D Gen](https://arxiv.org/abs/2303.05371)) also follow the same paradigm.
380
+ Though currently the performance of the origin 3D LDM's works are overall inferior to reconstruction-based methods, we believe the proposed method has much potential and scales better with more data and compute resources, and may yield better 3D editing performance due to its compatability with diffusion model.
381
+
382
+ ## :newspaper_roll: License
383
+
384
+ Distributed under the NTU S-Lab License. See `LICENSE` for more information.
385
+
386
+
387
+ ## Contact
388
+
389
+ If you have any question, please feel free to contact us via `lanyushi15@gmail.com` or Github issues.
__pycache__/gradio_app.cpython-310.pyc ADDED
Binary file (8.33 kB). View file
 
assets/ffhq_eval_pose.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d73c5a2925b957a64d4ac3a00dcb88cfab00bb476ab671b71f9cfcaf19cc977
3
+ size 4352
assets/i23d/single-img-cond/birthday-cake.gif ADDED

Git LFS Details

  • SHA256: 139e28118a6f43bb0f1b6d098a2fffab13624cd59263b72aef808dc70a136ac1
  • Pointer size: 131 Bytes
  • Size of remote file: 567 kB
assets/i23d/single-img-cond/chest.gif ADDED

Git LFS Details

  • SHA256: e42f5131707b35048257ba4d02acbccfab4e2ac2d1d587491051e78021ae0694
  • Pointer size: 131 Bytes
  • Size of remote file: 591 kB
assets/i23d/single-img-cond/flower.gif ADDED

Git LFS Details

  • SHA256: c24c54cddcedee3291ec53b09ed9e79823c2e4b3561d000681b13671e726e8ea
  • Pointer size: 131 Bytes
  • Size of remote file: 435 kB
assets/i23d/single-img-cond/genshin-house.gif ADDED

Git LFS Details

  • SHA256: b16b6147d040acddcb6ecf5eea42144660108f219dd2ab75dffc296aab5338f7
  • Pointer size: 131 Bytes
  • Size of remote file: 605 kB
assets/i23d/single-img-cond/robot.gif ADDED

Git LFS Details

  • SHA256: bbca8524ab5f96cd6c53416c1a9e49f92d79407109a9c193fc8faecd79094d14
  • Pointer size: 131 Bytes
  • Size of remote file: 501 kB
assets/i23d_examples/for_demo_inference/fox-input.png ADDED
assets/i23d_examples/for_demo_inference/genshin_building-input.png ADDED
assets/i23d_examples/for_demo_inference/sword-input.png ADDED
assets/i23d_examples/for_demo_inference/teasure_chest-input.png ADDED
assets/i23d_examples/instant_mesh_samples/bulldog-input.png ADDED
assets/i23d_examples/instant_mesh_samples/cake-input.png ADDED
assets/i23d_examples/instant_mesh_samples/cute_tiger-input.png ADDED
assets/i23d_examples/instant_mesh_samples/extinguisher-input.png ADDED
assets/i23d_examples/instant_mesh_samples/genshin_teapot-input.png ADDED
assets/i23d_examples/instant_mesh_samples/house2-input.png ADDED
assets/i23d_examples/instant_mesh_samples/mushroom_teapot-input.png ADDED
assets/i23d_examples/instant_mesh_samples/plant-input.png ADDED
assets/i23d_examples/instant_mesh_samples/robot-input.png ADDED
assets/i23d_examples/instant_mesh_samples/sorting_board-input.png ADDED
assets/input_cameras.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ce0c9413275642ff034bb7b93bd4dd1afff084ef2cbfdb4dcaa4f87fda68191
3
+ size 1594
assets/objv_eval_pose.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09b6e0eb22da1ca5d1e4a4fd1bfe5b08d65d1b1926621aa22601b67f20904f9a
3
+ size 4721
assets/render_cameras.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c118a971e74bd10f18821c1254e3e44a3adb55f752b36ebbca3e726df91a4e91
3
+ size 13183
assets/shapenet_eval_pose.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f53380bc2a91ed9beddc06dce68ec0e7c9a0be62770124b717b2ce086cbba8a6
3
+ size 10764
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_depth": 5.0,
3
+ "bbox": [
4
+ [
5
+ -0.330194056,
6
+ -0.449999958,
7
+ -0.263895959
8
+ ],
9
+ [
10
+ 0.330194056,
11
+ 0.450000018,
12
+ 0.263895959
13
+ ]
14
+ ],
15
+ "origin": [
16
+ 1.64323258,
17
+ 0.0,
18
+ 0.315478027
19
+ ],
20
+ "x_fov": 0.691150367,
21
+ "y_fov": 0.691150367,
22
+ "x": [
23
+ 1.2196297E-07,
24
+ 1.00000012,
25
+ 0.0
26
+ ],
27
+ "y": [
28
+ 0.188542932,
29
+ 0.0,
30
+ -0.982064962
31
+ ],
32
+ "z": [
33
+ -0.9820651,
34
+ 1.2196297E-07,
35
+ -0.188542932
36
+ ],
37
+ "scale": [
38
+ 0.0023696092,
39
+ 0.0023696092,
40
+ 0.0023696092
41
+ ],
42
+ "offset": [
43
+ 0.0,
44
+ -0.4037283,
45
+ -0.06950388
46
+ ]
47
+ }
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000.png ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_albedo.png ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_hdr.exr ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_mr.png ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_nd.exr ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00000/00000_ng.exr ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_depth": 5.0,
3
+ "bbox": [
4
+ [
5
+ -0.330194056,
6
+ -0.449999958,
7
+ -0.263895959
8
+ ],
9
+ [
10
+ 0.330194056,
11
+ 0.450000018,
12
+ 0.263895959
13
+ ]
14
+ ],
15
+ "origin": [
16
+ 1.58724082,
17
+ 0.425299883,
18
+ 0.315478027
19
+ ],
20
+ "x_fov": 0.691150367,
21
+ "y_fov": 0.691150367,
22
+ "x": [
23
+ -0.258818865,
24
+ 0.9659259,
25
+ 2.14746585E-08
26
+ ],
27
+ "y": [
28
+ 0.18211852,
29
+ 0.0487984978,
30
+ -0.982064962
31
+ ],
32
+ "z": [
33
+ -0.948601961,
34
+ -0.2541769,
35
+ -0.188542962
36
+ ],
37
+ "scale": [
38
+ 0.0023696092,
39
+ 0.0023696092,
40
+ 0.0023696092
41
+ ],
42
+ "offset": [
43
+ 0.0,
44
+ -0.4037283,
45
+ -0.06950388
46
+ ]
47
+ }
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001.png ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_albedo.png ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_hdr.exr ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_mr.png ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_nd.exr ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00001/00001_ng.exr ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_depth": 5.0,
3
+ "bbox": [
4
+ [
5
+ -0.330194056,
6
+ -0.449999958,
7
+ -0.263895959
8
+ ],
9
+ [
10
+ 0.330194056,
11
+ 0.450000018,
12
+ 0.263895959
13
+ ]
14
+ ],
15
+ "origin": [
16
+ 1.42308116,
17
+ 0.8216163,
18
+ 0.315478027
19
+ ],
20
+ "x_fov": 0.691150367,
21
+ "y_fov": 0.691150367,
22
+ "x": [
23
+ -0.50000006,
24
+ 0.8660254,
25
+ -6.586047E-09
26
+ ],
27
+ "y": [
28
+ 0.163282961,
29
+ 0.0942714661,
30
+ -0.982064962
31
+ ],
32
+ "z": [
33
+ -0.8504932,
34
+ -0.4910325,
35
+ -0.188542932
36
+ ],
37
+ "scale": [
38
+ 0.0023696092,
39
+ 0.0023696092,
40
+ 0.0023696092
41
+ ],
42
+ "offset": [
43
+ 0.0,
44
+ -0.4037283,
45
+ -0.06950388
46
+ ]
47
+ }
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002.png ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_albedo.png ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_hdr.exr ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_mr.png ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_nd.exr ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00002/00002_ng.exr ADDED
assets/stage1_vae_reconstruction/Objaverse/Animals/0/10120/campos_512_v4/00003/00003.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_depth": 5.0,
3
+ "bbox": [
4
+ [
5
+ -0.330194056,
6
+ -0.449999958,
7
+ -0.263895959
8
+ ],
9
+ [
10
+ 0.330194056,
11
+ 0.450000018,
12
+ 0.263895959
13
+ ]
14
+ ],
15
+ "origin": [
16
+ 1.16194093,
17
+ 1.16194093,
18
+ 0.315478027
19
+ ],
20
+ "x_fov": 0.691150367,
21
+ "y_fov": 0.691150367,
22
+ "x": [
23
+ -0.707106769,
24
+ 0.707106769,
25
+ -5.59717162E-10
26
+ ],
27
+ "y": [
28
+ 0.13332,
29
+ 0.13332,
30
+ -0.982064962
31
+ ],
32
+ "z": [
33
+ -0.6944248,
34
+ -0.694424748,
35
+ -0.188542962
36
+ ],
37
+ "scale": [
38
+ 0.0023696092,
39
+ 0.0023696092,
40
+ 0.0023696092
41
+ ],
42
+ "offset": [
43
+ 0.0,
44
+ -0.4037283,
45
+ -0.06950388
46
+ ]
47
+ }