Improve model card with pipeline tag, links, and usage example
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,3 +1,72 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
pipeline_tag: image-to-3d
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Gen-3Diffusion: Realistic Image-to-3D Generation via 2D & 3D Diffusion Synergy
|
| 7 |
+
|
| 8 |
+
This repository contains the Gen-3Diffusion model presented in the paper [Gen-3Diffusion: Realistic Image-to-3D Generation via 2D & 3D Diffusion Synergy](https://huggingface.co/papers/2412.06698).
|
| 9 |
+
|
| 10 |
+
Gen-3Diffusion addresses the challenging problem of creating realistic 3D objects and clothed avatars from a single RGB image. It leverages a pre-trained 2D diffusion model and a 3D diffusion model, synchronizing them at both training and sampling time. This synergy allows the 2D model to provide strong generalization for shapes, while the 3D model enhances multi-view consistency, leading to high-fidelity geometry and texture in generated 3D objects and avatars.
|
| 11 |
+
|
| 12 |
+
- [Project Page](https://yuxuan-xue.com/gen-3diffusion)
|
| 13 |
+
- [Code](https://github.com/YuxuanSnow/Gen3Diffusion)
|
| 14 |
+
|
| 15 |
+
## Key Insight :raised_hands:
|
| 16 |
+
- 2D foundation models are powerful but output lacks 3D consistency!
|
| 17 |
+
- 3D generative models can reconstruct 3D representation but is poor in generalization!
|
| 18 |
+
- How to combine 2D foundation models with 3D generative models?:
|
| 19 |
+
- they are both diffusion-based generative models => **Can be synchronized at each diffusion step**
|
| 20 |
+
- 2D foundation model helps 3D generation => **provides strong prior informations about 3D shape**
|
| 21 |
+
- 3D representation guides 2D diffusion sampling => **use rendered output from 3D reconstruction for reverse sampling, where 3D consistency is guaranteed**
|
| 22 |
+
|
| 23 |
+
## Pretrained Weights
|
| 24 |
+
Our pretrained weights can be downloaded from Hugging Face.
|
| 25 |
+
```bash
|
| 26 |
+
mkdir checkpoints_obj && cd checkpoints_obj
|
| 27 |
+
wget https://huggingface.co/yuxuanx/gen3diffusion/resolve/main/model.safetensors
|
| 28 |
+
wget https://huggingface.co/yuxuanx/gen3diffusion/resolve/main/model_1.safetensors
|
| 29 |
+
wget https://huggingface.co/yuxuanx/gen3diffusion/resolve/main/pifuhd.pt
|
| 30 |
+
cd ..
|
| 31 |
+
```
|
| 32 |
+
The avatar reconstruction module is same to Human-3Diffusion. Please skip if you already installed Human-3Diffusion.
|
| 33 |
+
```bash
|
| 34 |
+
mkdir checkpoints_avatar && cd checkpoints_avatar
|
| 35 |
+
wget https://huggingface.co/yuxuanx/human3diffusion/resolve/main/model.safetensors
|
| 36 |
+
wget https://huggingface.co/yuxuanx/human3diffusion/resolve/main/model_1.safetensors
|
| 37 |
+
wget https://huggingface.co/yuxuanx/human3diffusion/resolve/main/pifuhd.pt
|
| 38 |
+
cd ..
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Sample Usage (Inference)
|
| 42 |
+
The following commands illustrate how to use the model for image-to-3D object and avatar generation. Please refer to the [GitHub repository](https://github.com/YuxuanSnow/Gen3Diffusion) for full installation and setup instructions.
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
# given one image of object, generate 3D-GS object
|
| 46 |
+
# subject should be centered in a square image, please crop properly
|
| 47 |
+
# recenter plays a huge role in object reconstruction. Please adjust the recentering if the reconstruction doesn't work well
|
| 48 |
+
python infer.py --test_imgs test_imgs_obj --output output_obj --checkpoints checkpoints_obj
|
| 49 |
+
|
| 50 |
+
# given generated 3D-GS, perform TSDF mesh extraction
|
| 51 |
+
python infer_mesh.py --test_imgs test_imgs_obj --output output_obj --checkpoints checkpoints_obj --mesh_quality high
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
# given one image of human, generate 3D-GS avatar
|
| 56 |
+
# subject should be centered in a square image, please crop properly
|
| 57 |
+
python infer.py --test_imgs test_imgs_avatar --output output_avatar --checkpoints checkpoints_avatar
|
| 58 |
+
|
| 59 |
+
# given generated 3D-GS, perform TSDF mesh extraction
|
| 60 |
+
python infer_mesh.py --test_imgs test_imgs_avatar --output output_avatar --checkpoints checkpoints_avatar --mesh_quality high
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
## Citation :writing_hand:
|
| 64 |
+
If you find our work helpful or inspiring, please feel free to cite it:
|
| 65 |
+
```bibtex
|
| 66 |
+
@inproceedings{xue2024gen3diffusion,
|
| 67 |
+
title = {{Gen-3Diffusion: Realistic Image-to-3D Generation via 2D & 3D Diffusion Synergy }},
|
| 68 |
+
author = {Xue, Yuxuan and Xie, Xianghui and Marin, Riccardo and Pons-Moll, Gerard.},
|
| 69 |
+
journal = {Arxiv},
|
| 70 |
+
year = {2024},
|
| 71 |
+
}
|
| 72 |
+
```
|