Enhance model card with metadata, links, and usage examples
Browse filesThis PR significantly enhances the model card by adding:
- The `pipeline_tag: image-to-3d` to improve discoverability on the Hub.
- Direct links to the paper, project page, and GitHub repository.
- Comprehensive usage examples for installation, pretrained weights, and inference, extracted directly from the GitHub README.
Please review and merge if everything looks good!
README.md
CHANGED
|
@@ -1,3 +1,94 @@
|
|
| 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, which achieves realistic image-to-3D generation by leveraging a pre-trained 2D diffusion model and a 3D diffusion model, as presented in the paper:
|
| 9 |
+
[**Gen-3Diffusion: Realistic Image-to-3D Generation via 2D & 3D Diffusion Synergy**](https://huggingface.co/papers/2412.06698)
|
| 10 |
+
|
| 11 |
+
Project Page: [https://yuxuan-xue.com/gen-3diffusion](https://yuxuan-xue.com/gen-3diffusion)
|
| 12 |
+
Code: [https://github.com/YuxuanSnow/Gen3Diffusion](https://github.com/YuxuanSnow/Gen3Diffusion)
|
| 13 |
+
|
| 14 |
+

|
| 15 |
+
|
| 16 |
+
## Key Insight :raised_hands:
|
| 17 |
+
- 2D foundation models are powerful but output lacks 3D consistency!
|
| 18 |
+
- 3D generative models can reconstruct 3D representation but is poor in generalization!
|
| 19 |
+
- How to combine 2D foundation models with 3D generative models?:
|
| 20 |
+
- they are both diffusion-based generative models => **Can be synchronized at each diffusion step**
|
| 21 |
+
- 2D foundation model helps 3D generation => **provides strong prior informations about 3D shape**
|
| 22 |
+
- 3D representation guides 2D diffusion sampling => **use rendered output from 3D reconstruction for reverse sampling, where 3D consistency is guaranteed**
|
| 23 |
+
|
| 24 |
+
## Install
|
| 25 |
+
Same Conda environment to Human-3Diffusion. Please skip if you already installed it.
|
| 26 |
+
```bash
|
| 27 |
+
# Conda environment
|
| 28 |
+
conda create -n gen3diffusion python=3.10
|
| 29 |
+
conda activate gen3diffusion
|
| 30 |
+
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
|
| 31 |
+
pip install xformers==0.0.22.post4 --index-url https://download.pytorch.org/whl/cu121
|
| 32 |
+
|
| 33 |
+
# Gaussian Opacity Fields
|
| 34 |
+
git clone https://github.com/YuxuanSnow/gaussian-opacity-fields.git
|
| 35 |
+
cd gaussian-opacity-fields && pip install submodules/diff-gaussian-rasterization
|
| 36 |
+
pip install submodules/simple-knn/ && cd ..
|
| 37 |
+
export CPATH=/usr/local/cuda-12.1/targets/x86_64-linux/include:$CPATH
|
| 38 |
+
|
| 39 |
+
# Dependencies
|
| 40 |
+
pip install -r requirements.txt
|
| 41 |
+
|
| 42 |
+
# TSDF Fusion (Mesh extraction) Dependencies
|
| 43 |
+
pip install --user numpy opencv-python scikit-image numba
|
| 44 |
+
pip install --user pycuda
|
| 45 |
+
pip install scipy==1.11
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
## Pretrained Weights
|
| 49 |
+
Our pretrained weight can be downloaded from huggingface.
|
| 50 |
+
```bash
|
| 51 |
+
mkdir checkpoints_obj && cd checkpoints_obj
|
| 52 |
+
wget https://huggingface.co/yuxuanx/gen3diffusion/resolve/main/model.safetensors
|
| 53 |
+
wget https://huggingface.co/yuxuanx/gen3diffusion/resolve/main/model_1.safetensors
|
| 54 |
+
wget https://huggingface.co/yuxuanx/gen3diffusion/resolve/main/pifuhd.pt
|
| 55 |
+
cd ..
|
| 56 |
+
```
|
| 57 |
+
The avatar reconstruction module is same to Human-3Diffusion. Please skip if you already installed Human-3Diffusion.
|
| 58 |
+
```bash
|
| 59 |
+
mkdir checkpoints_avatar && cd checkpoints_avatar
|
| 60 |
+
wget https://huggingface.co/yuxuanx/human3diffusion/resolve/main/model.safetensors
|
| 61 |
+
wget https://huggingface.co/yuxuanx/human3diffusion/resolve/main/model_1.safetensors
|
| 62 |
+
wget https://huggingface.co/yuxuanx/human3diffusion/resolve/main/pifuhd.pt
|
| 63 |
+
cd ..
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Inference
|
| 67 |
+
```bash
|
| 68 |
+
# given one image of object, generate 3D-GS object
|
| 69 |
+
# subject should be centered in a square image, please crop properly
|
| 70 |
+
# recenter plays a huge role in object reconstruction. Please adjust the recentering if the reconstruction doesn't work well
|
| 71 |
+
python infer.py --test_imgs test_imgs_obj --output output_obj --checkpoints checkpoints_obj
|
| 72 |
+
|
| 73 |
+
# given generated 3D-GS, perform TSDF mesh extraction
|
| 74 |
+
python infer_mesh.py --test_imgs test_imgs_obj --output output_obj --checkpoints checkpoints_obj --mesh_quality high
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
```bash
|
| 78 |
+
# given one image of human, generate 3D-GS avatar
|
| 79 |
+
# subject should be centered in a square image, please crop properly
|
| 80 |
+
python infer.py --test_imgs test_imgs_avatar --output output_avatar --checkpoints checkpoints_avatar
|
| 81 |
+
|
| 82 |
+
# given generated 3D-GS, perform TSDF mesh extraction
|
| 83 |
+
python infer_mesh.py --test_imgs test_imgs_avatar --output output_avatar --checkpoints checkpoints_avatar --mesh_quality high
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## Citation :writing_hand:
|
| 87 |
+
```bibtex
|
| 88 |
+
@inproceedings{xue2024gen3diffusion,
|
| 89 |
+
title = {{Gen-3Diffusion: Realistic Image-to-3D Generation via 2D & 3D Diffusion Synergy }},
|
| 90 |
+
author = {Xue, Yuxuan and Xie, Xianghui and Marin, Riccardo and Pons-Moll, Gerard.},\
|
| 91 |
+
journal = {Arxiv},\
|
| 92 |
+
year = {2024},\
|
| 93 |
+
}
|
| 94 |
+
```
|