Improve model card: add library_name, full abstract, and usage example

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +115 -2
README.md CHANGED
@@ -1,12 +1,125 @@
1
  ---
2
  license: mit
3
  pipeline_tag: image-to-image
 
4
  ---
 
5
  # [ICCV 2025] GenStereo: Towards Open-World Generation of Stereo Images and Unsupervised Matching
6
 
7
 
8
  [![Project Site](https://img.shields.io/badge/Project-Web-green)](https://qjizhi.github.io/genstereo) [![Spaces](https://img.shields.io/badge/Spaces-Demo-yellow?logo=huggingface)](https://huggingface.co/spaces/FQiao/GenStereo) [![Github](https://img.shields.io/badge/Github-Repo-orange?logo=github)](https://github.com/Qjizhi/GenStereo) [![Models](https://img.shields.io/badge/Models-checkpoints-blue?logo=huggingface)](https://huggingface.co/FQiao/GenStereo-sd2.1/tree/main) [![arXiv](https://img.shields.io/badge/arXiv-2503.12720-red?logo=arxiv)](https://arxiv.org/abs/2503.12720)
9
 
10
 
11
- This repository contains the model presented in [GenStereo: Towards Open-World Generation of Stereo Images and Unsupervised Matching](https://huggingface.co/papers/2503.12720). The models are finetuned on Stable Diffusion v2.1.
12
- ![](teaser_coco.jpg).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  pipeline_tag: image-to-image
4
+ library_name: diffusers
5
  ---
6
+
7
  # [ICCV 2025] GenStereo: Towards Open-World Generation of Stereo Images and Unsupervised Matching
8
 
9
 
10
  [![Project Site](https://img.shields.io/badge/Project-Web-green)](https://qjizhi.github.io/genstereo) [![Spaces](https://img.shields.io/badge/Spaces-Demo-yellow?logo=huggingface)](https://huggingface.co/spaces/FQiao/GenStereo) [![Github](https://img.shields.io/badge/Github-Repo-orange?logo=github)](https://github.com/Qjizhi/GenStereo) [![Models](https://img.shields.io/badge/Models-checkpoints-blue?logo=huggingface)](https://huggingface.co/FQiao/GenStereo-sd2.1/tree/main) [![arXiv](https://img.shields.io/badge/arXiv-2503.12720-red?logo=arxiv)](https://arxiv.org/abs/2503.12720)
11
 
12
 
13
+ This repository contains the model presented in [GenStereo: Towards Open-World Generation of Stereo Images and Unsupervised Matching](https://arxiv.org/abs/2503.12720). The models are finetuned on Stable Diffusion v2.1.
14
+ ![](teaser_coco.jpg)
15
+
16
+ ## Abstract
17
+ Stereo images are fundamental to numerous applications, including extended reality (XR) devices, autonomous driving, and robotics. Unfortunately, acquiring high-quality stereo images remains challenging due to the precise calibration requirements of dual-camera setups and the complexity of obtaining accurate, dense disparity maps. Existing stereo image generation methods typically focus on either visual quality for viewing or geometric accuracy for matching, but not both. We introduce GenStereo, a diffusion-based approach, to bridge this gap. The method includes two primary innovations (1) conditioning the diffusion process on a disparity-aware coordinate embedding and a warped input image, allowing for more precise stereo alignment than previous methods, and (2) an adaptive fusion mechanism that intelligently combines the diffusion-generated image with a warped image, improving both realism and disparity consistency. Through extensive training on 11 diverse stereo datasets, GenStereo demonstrates strong generalization ability. GenStereo achieves state-of-the-art performance in both stereo image generation and unsupervised stereo matching tasks.
18
+
19
+ ## How to use
20
+
21
+ ### Environment
22
+
23
+ We tested our codes on Ubuntu with nVidia A100 GPU. If you're using other machines like Windows, consider using Docker. You can either add packages to your python environment or use Docker to build an python environment. Commands below are all expected to run in the root directory of the repository.
24
+
25
+ We tested the environment with python `>=3.10` and CUDA `=11.8`. To add mandatory dependencies run the command below.
26
+
27
+ ``` shell
28
+ pip install -r requirements.txt
29
+ ```
30
+
31
+ To run developmental codes such as the example provided in jupyter notebook and the live demo implemented by gradio, add extra dependencies via the command below.
32
+
33
+ ``` shell
34
+ pip install -r requirements_dev.txt
35
+ ```
36
+
37
+ ### Download pretrained models
38
+
39
+ GenStereo uses pretrained models which consist of both our finetuned models and publicly available third-party ones. Download all the models to `checkpoints` directory or anywhere of your choice. You can do it manually or by the [download_models.sh](scripts/download_models.sh) script.
40
+
41
+ #### Download script
42
+
43
+ ``` shell
44
+ bash scripts/download_models.sh
45
+ ```
46
+
47
+ #### Manual download
48
+
49
+ > [!NOTE]
50
+ > Models and checkpoints provided below may be distributed under different licenses. Users are required to check licenses carefully on their behalf.
51
+
52
+ 1. Our finetuned models, we provide two versions of GenStereo
53
+ - v1.5: 512px, faster, [model card](https://huggingface.co/FQiao/GenStereo).
54
+ - v2.1: 768px, better performance, high resolution, takes more time, [model card](https://huggingface.co/FQiao/GenStereo-sd2.1).
55
+ 2. Pretrained models:
56
+ - [sd-vae-ft-mse](https://huggingface.co/stabilityai/sd-vae-ft-mse)
57
+ - download `config.json` and `diffusion_pytorch_model.safetensors` to `checkpoints/sd-vae-ft-mse`
58
+ - [sd-image-variations-diffusers](https://huggingface.co/lambdalabs/sd-image-variations-diffusers)
59
+ - download `image_encoder/config.json` and `image_encoder/pytorch_model.bin` to `checkpoints/image_encoder`
60
+ 3. MDE (Monocular Depth Estimation) models
61
+ - We use [Depth Anything V2](https://github.com/DepthAnything/Depth-Anything-V2) as the MDE model and get the disparity maps.
62
+ The final `checkpoints` directory must look like this:
63
+
64
+ ```
65
+ .
66
+ β”œβ”€β”€ depth_anything_v2_vitl.pth
67
+ β”œβ”€β”€ genstereo-v1.5
68
+ β”‚ β”œβ”€β”€ config.json
69
+ β”‚ β”œβ”€β”€ denoising_unet.pth
70
+ β”‚ β”œβ”€β”€ fusion_layer.pth
71
+ β”‚ β”œβ”€β”€ pose_guider.pth
72
+ β”‚ └── reference_unet.pth
73
+ β”œβ”€β”€ genstereo-v2.1
74
+ β”‚ β”œβ”€β”€ config.json
75
+ β”‚ β”œβ”€β”€ denoising_unet.pth
76
+ β”‚ β”œβ”€β”€ fusion_layer.pth
77
+ β”‚ β”œβ”€β”€ pose_guider.pth
78
+ β”‚ └── reference_unet.pth
79
+ β”œβ”€β”€ image_encoder
80
+ β”‚ β”œβ”€β”€ config.json
81
+ β”‚ └── pytorch_model.bin
82
+ └── sd-vae-ft-mse
83
+ β”œβ”€β”€ config.json
84
+ └── diffusion_pytorch_model.safetensors
85
+ ```
86
+
87
+ ### Inference
88
+ You can easily run the inference code by running the following command, and the results will be save under `./vis` folder.
89
+
90
+ ```bash
91
+ python test.py /path/to/your/image
92
+ ```
93
+
94
+ ### Gradio live demo
95
+
96
+ An interactive live demo is also available. Start gradio demo by running the command below, and goto [http://127.0.0.1:7860/](http://127.0.0.1:7860/)
97
+ If you are running it on the server, be sure to forward the port 7860.
98
+
99
+ Or you can just visit [Spaces](https://huggingface.co/spaces/FQiao/GenStereo) hosted by Hugging Face to try it now.
100
+
101
+ ```shell
102
+ python app.py
103
+ ```
104
+
105
+ ## Train
106
+ Please read [Train_Guide.md](./Trian_Guide.md).
107
+
108
+ ## Citation
109
+
110
+ ``` bibtex
111
+ @article{qiao2025genstereo,
112
+ author = {Feng Qiao and Zhexiao Xiong and Eric Xing and Nathan Jacobs},
113
+ title = {GenStereo: Towards Open-World Generation of Stereo Images and Unsupervised Matching},
114
+ journal = {arXiv preprint},
115
+ volume = {arXiv:2503.12720},
116
+ year = {2025},
117
+ url = {https://doi.org/10.48550/arXiv.2503.12720},
118
+ archivePrefix = {arXiv},
119
+ primaryClass = {cs.CV}
120
+ }
121
+ ```
122
+
123
+ ## Acknowledgements
124
+
125
+ Our codes are based on [GenWarp](https://github.com/sony/genwarp), [Moore-AnimateAnyone](https://github.com/MooreThreads/Moore-AnimateAnyone) and other repositories. We thank the authors of relevant repositories and papers.