upgradio
Browse files
README.md
CHANGED
@@ -2,219 +2,10 @@
|
|
2 |
title: Hallo
|
3 |
emoji: π
|
4 |
sdk: gradio
|
5 |
-
sdk_version: 4.
|
6 |
app_file: app.py
|
7 |
pinned: false
|
8 |
suggested_hardware: l4x1
|
9 |
short_description: Generate realistic talking heads from image+audio
|
10 |
---
|
11 |
|
12 |
-
<h1 align='Center'>Hallo: Hierarchical Audio-Driven Visual Synthesis for Portrait Image Animation</h1>
|
13 |
-
|
14 |
-
<div align='Center'>
|
15 |
-
<a href='https://github.com/xumingw' target='_blank'>Mingwang Xu</a><sup>1*</sup> 
|
16 |
-
<a href='https://github.com/crystallee-ai' target='_blank'>Hui Li</a><sup>1*</sup> 
|
17 |
-
<a href='https://github.com/subazinga' target='_blank'>Qingkun Su</a><sup>1*</sup> 
|
18 |
-
<a href='https://github.com/NinoNeumann' target='_blank'>Hanlin Shang</a><sup>1</sup> 
|
19 |
-
<a href='https://github.com/AricGamma' target='_blank'>Liwei Zhang</a><sup>1</sup> 
|
20 |
-
<a href='https://github.com/cnexah' target='_blank'>Ce Liu</a><sup>3</sup> 
|
21 |
-
</div>
|
22 |
-
<div align='center'>
|
23 |
-
<a href='https://jingdongwang2017.github.io/' target='_blank'>Jingdong Wang</a><sup>2</sup> 
|
24 |
-
<a href='https://yoyo000.github.io/' target='_blank'>Yao Yao</a><sup>4</sup> 
|
25 |
-
<a href='https://sites.google.com/site/zhusiyucs/home' target='_blank'>Siyu Zhu</a><sup>1</sup> 
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<div align='Center'>
|
29 |
-
<sup>1</sup>Fudan University  <sup>2</sup>Baidu Inc  <sup>3</sup>ETH Zurich  <sup>4</sup>Nanjing University
|
30 |
-
</div>
|
31 |
-
|
32 |
-
<br>
|
33 |
-
<div align='Center'>
|
34 |
-
<a href='https://github.com/fudan-generative-vision/hallo'><img src='https://img.shields.io/github/stars/fudan-generative-vision/hallo?style=social'></a>
|
35 |
-
<a href='https://fudan-generative-vision.github.io/hallo/#/'><img src='https://img.shields.io/badge/Project-HomePage-Green'></a>
|
36 |
-
<a href='https://arxiv.org/pdf/2406.08801'><img src='https://img.shields.io/badge/Paper-Arxiv-red'></a>
|
37 |
-
<a href='https://huggingface.co/fudan-generative-ai/hallo'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20HuggingFace-Model-yellow'></a>
|
38 |
-
<a href='assets/wechat.jpeg'><img src='https://badges.aleen42.com/src/wechat.svg'></a>
|
39 |
-
</div>
|
40 |
-
|
41 |
-
<br>
|
42 |
-
|
43 |
-
# Showcase
|
44 |
-
|
45 |
-
|
46 |
-
https://github.com/fudan-generative-vision/hallo/assets/17402682/294e78ef-c60d-4c32-8e3c-7f8d6934c6bd
|
47 |
-
|
48 |
-
|
49 |
-
# Framework
|
50 |
-
|
51 |
-
![abstract](assets/framework_1.jpg)
|
52 |
-
![framework](assets/framework_2.jpg)
|
53 |
-
|
54 |
-
# News
|
55 |
-
|
56 |
-
- **`2024/06/15`**: πππ Release the first version on [GitHub](https://github.com/fudan-generative-vision/hallo).
|
57 |
-
- **`2024/06/15`**: β¨β¨β¨ Release some images and audios for inference testing on [Huggingface](https://huggingface.co/datasets/fudan-generative-ai/hallo_inference_samples).
|
58 |
-
|
59 |
-
# Installation
|
60 |
-
|
61 |
-
- System requirement: Ubuntu 20.04/Ubuntu 22.04, Cuda 12.1
|
62 |
-
- Tested GPUs: A100
|
63 |
-
|
64 |
-
Create conda environment:
|
65 |
-
|
66 |
-
```bash
|
67 |
-
conda create -n hallo python=3.10
|
68 |
-
conda activate hallo
|
69 |
-
```
|
70 |
-
|
71 |
-
Install packages with `pip`
|
72 |
-
|
73 |
-
```bash
|
74 |
-
pip install -r requirements.txt
|
75 |
-
pip install .
|
76 |
-
```
|
77 |
-
|
78 |
-
Besides, ffmpeg is also need:
|
79 |
-
```bash
|
80 |
-
apt-get install ffmpeg
|
81 |
-
```
|
82 |
-
|
83 |
-
# Inference
|
84 |
-
|
85 |
-
The inference entrypoint script is `scripts/inference.py`. Before testing your cases, there are two preparations need to be completed:
|
86 |
-
|
87 |
-
1. [Download all required pretrained models](#download-pretrained-models).
|
88 |
-
2. [Run inference](#run-inference).
|
89 |
-
|
90 |
-
## Download pretrained models
|
91 |
-
|
92 |
-
You can easily get all pretrained models required by inference from our [HuggingFace repo](https://huggingface.co/fudan-generative-ai/hallo).
|
93 |
-
|
94 |
-
Clone the the pretrained models into `${PROJECT_ROOT}/pretrained_models` directory by cmd below:
|
95 |
-
|
96 |
-
```shell
|
97 |
-
git lfs install
|
98 |
-
git clone https://huggingface.co/fudan-generative-ai/hallo pretrained_models
|
99 |
-
```
|
100 |
-
|
101 |
-
Or you can download them separately from their source repo:
|
102 |
-
|
103 |
-
- [hallo](https://huggingface.co/fudan-generative-ai/hallo/tree/main/hallo): Our checkpoints consist of denoising UNet, face locator, image & audio proj.
|
104 |
-
- [audio_separator](https://huggingface.co/huangjackson/Kim_Vocal_2): Kim\_Vocal\_2 MDX-Net vocal removal model by [KimberleyJensen](https://github.com/KimberleyJensen). (_Thanks to runwayml_)
|
105 |
-
- [insightface](https://github.com/deepinsight/insightface/tree/master/python-package#model-zoo): 2D and 3D Face Analysis placed into `pretrained_models/face_analysis/models/`. (_Thanks to deepinsight_)
|
106 |
-
- [face landmarker](https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task): Face detection & mesh model from [mediapipe](https://ai.google.dev/edge/mediapipe/solutions/vision/face_landmarker#models) placed into `pretrained_models/face_analysis/models`.
|
107 |
-
- [motion module](https://github.com/guoyww/AnimateDiff/blob/main/README.md#202309-animatediff-v2): motion module from [AnimateDiff](https://github.com/guoyww/AnimateDiff). (_Thanks to guoyww_).
|
108 |
-
- [sd-vae-ft-mse](https://huggingface.co/stabilityai/sd-vae-ft-mse): Weights are intended to be used with the diffusers library. (_Thanks to stablilityai_)
|
109 |
-
- [StableDiffusion V1.5](https://huggingface.co/runwayml/stable-diffusion-v1-5): Initialized and fine-tuned from Stable-Diffusion-v1-2. (_Thanks to runwayml_)
|
110 |
-
- [wav2vec](https://huggingface.co/facebook/wav2vec2-base-960h): wav audio to vector model from [Facebook](https://huggingface.co/facebook/wav2vec2-base-960h).
|
111 |
-
|
112 |
-
Finally, these pretrained models should be organized as follows:
|
113 |
-
|
114 |
-
```text
|
115 |
-
./pretrained_models/
|
116 |
-
|-- audio_separator/
|
117 |
-
| `-- Kim_Vocal_2.onnx
|
118 |
-
|-- face_analysis/
|
119 |
-
| `-- models/
|
120 |
-
| |-- face_landmarker_v2_with_blendshapes.task # face landmarker model from mediapipe
|
121 |
-
| |-- 1k3d68.onnx
|
122 |
-
| |-- 2d106det.onnx
|
123 |
-
| |-- genderage.onnx
|
124 |
-
| |-- glintr100.onnx
|
125 |
-
| `-- scrfd_10g_bnkps.onnx
|
126 |
-
|-- motion_module/
|
127 |
-
| `-- mm_sd_v15_v2.ckpt
|
128 |
-
|-- sd-vae-ft-mse/
|
129 |
-
| |-- config.json
|
130 |
-
| `-- diffusion_pytorch_model.safetensors
|
131 |
-
|-- stable-diffusion-v1-5/
|
132 |
-
| |-- feature_extractor/
|
133 |
-
| | `-- preprocessor_config.json
|
134 |
-
| |-- model_index.json
|
135 |
-
| |-- unet/
|
136 |
-
| | |-- config.json
|
137 |
-
| | `-- diffusion_pytorch_model.safetensors
|
138 |
-
| `-- v1-inference.yaml
|
139 |
-
`-- wav2vec/
|
140 |
-
|-- wav2vec2-base-960h/
|
141 |
-
| |-- config.json
|
142 |
-
| |-- feature_extractor_config.json
|
143 |
-
| |-- model.safetensors
|
144 |
-
| |-- preprocessor_config.json
|
145 |
-
| |-- special_tokens_map.json
|
146 |
-
| |-- tokenizer_config.json
|
147 |
-
| `-- vocab.json
|
148 |
-
```
|
149 |
-
|
150 |
-
## Run inference
|
151 |
-
|
152 |
-
Simply to run the `scripts/inference.py` and pass `source_image` and `driving_audio` as input:
|
153 |
-
|
154 |
-
```bash
|
155 |
-
python scripts/inference.py --source_image your_image.png --driving_audio your_audio.wav
|
156 |
-
```
|
157 |
-
|
158 |
-
Animation results will be saved as `${PROJECT_ROOT}/.cache/output.mp4` by default. You can pass `--output` to specify the output file name.
|
159 |
-
|
160 |
-
For more options:
|
161 |
-
|
162 |
-
```shell
|
163 |
-
usage: inference.py [-h] [-c CONFIG] [--source_image SOURCE_IMAGE] [--driving_audio DRIVING_AUDIO] [--output OUTPUT] [--pose_weight POSE_WEIGHT]
|
164 |
-
[--face_weight FACE_WEIGHT] [--lip_weight LIP_WEIGHT] [--face_expand_ratio FACE_EXPAND_RATIO]
|
165 |
-
|
166 |
-
options:
|
167 |
-
-h, --help show this help message and exit
|
168 |
-
-c CONFIG, --config CONFIG
|
169 |
-
--source_image SOURCE_IMAGE
|
170 |
-
source image
|
171 |
-
--driving_audio DRIVING_AUDIO
|
172 |
-
driving audio
|
173 |
-
--output OUTPUT output video file name
|
174 |
-
--pose_weight POSE_WEIGHT
|
175 |
-
weight of pose
|
176 |
-
--face_weight FACE_WEIGHT
|
177 |
-
weight of face
|
178 |
-
--lip_weight LIP_WEIGHT
|
179 |
-
weight of lip
|
180 |
-
--face_expand_ratio FACE_EXPAND_RATIO
|
181 |
-
face region
|
182 |
-
```
|
183 |
-
|
184 |
-
# Roadmap
|
185 |
-
|
186 |
-
| Status | Milestone | ETA |
|
187 |
-
| :----: | :---------------------------------------------------------------------------------------------------- | :--------: |
|
188 |
-
| β
| **[Inference source code meet everyone on GitHub](https://github.com/fudan-generative-vision/hallo)** | 2024-06-15 |
|
189 |
-
| β
| **[Pretrained models on Huggingface](https://huggingface.co/fudan-generative-ai/hallo)** | 2024-06-15 |
|
190 |
-
| πππ | **[Traning: data preparation and training scripts]()** | 2024-06-25 |
|
191 |
-
|
192 |
-
# Citation
|
193 |
-
|
194 |
-
If you find our work useful for your research, please consider citing the paper:
|
195 |
-
|
196 |
-
```
|
197 |
-
@misc{xu2024hallo,
|
198 |
-
title={Hallo: Hierarchical Audio-Driven Visual Synthesis for Portrait Image Animation},
|
199 |
-
author={Mingwang Xu and Hui Li and Qingkun Su and Hanlin Shang and Liwei Zhang and Ce Liu and Jingdong Wang and Yao Yao and Siyu zhu},
|
200 |
-
year={2024},
|
201 |
-
eprint={2406.08801},
|
202 |
-
archivePrefix={arXiv},
|
203 |
-
primaryClass={cs.CV}
|
204 |
-
}
|
205 |
-
```
|
206 |
-
|
207 |
-
# Opportunities available
|
208 |
-
|
209 |
-
Multiple research positions are open at the **Generative Vision Lab, Fudan University**! Include:
|
210 |
-
|
211 |
-
- Research assistant
|
212 |
-
- Postdoctoral researcher
|
213 |
-
- PhD candidate
|
214 |
-
- Master students
|
215 |
-
|
216 |
-
Interested individuals are encouraged to contact us at [siyuzhu@fudan.edu.cn](mailto://siyuzhu@fudan.edu.cn) for further information.
|
217 |
-
|
218 |
-
# Social Risks and Mitigations
|
219 |
-
|
220 |
-
The development of portrait image animation technologies driven by audio inputs poses social risks, such as the ethical implications of creating realistic portraits that could be misused for deepfakes. To mitigate these risks, it is crucial to establish ethical guidelines and responsible use practices. Privacy and consent concerns also arise from using individuals' images and voices. Addressing these involves transparent data usage policies, informed consent, and safeguarding privacy rights. By addressing these risks and implementing mitigations, the research aims to ensure the responsible and ethical development of this technology.
|
|
|
2 |
title: Hallo
|
3 |
emoji: π
|
4 |
sdk: gradio
|
5 |
+
sdk_version: 4.37.1
|
6 |
app_file: app.py
|
7 |
pinned: false
|
8 |
suggested_hardware: l4x1
|
9 |
short_description: Generate realistic talking heads from image+audio
|
10 |
---
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|