mohamedemam commited on
Commit
69a132b
ยท
verified ยท
1 Parent(s): 6e52c6e

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +176 -0
README.md ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # [ICCV 2025] FLOAT: Generative Motion Latent Flow Matching for Audio-driven Talking Portrait
2
+ Official Pytorch Implementation of FLOAT; Flow Matching for Audio-driven Talking Portrait Video Generation
3
+
4
+ ![preview](./assets/float-abstract.png)
5
+
6
+ **FLOAT: Generative Motion Latent Flow Matching for Audio-driven Talking Portrait**<br>
7
+ [Taekyung Ki](https://taekyungki.github.io), [Dongchan Min](https://kevinmin95.github.io), [Gyeongsu Chae](https://www.aistudios.com/ko)
8
+
9
+ Project Page: https://deepbrainai-research.github.io/float/
10
+
11
+ **Abstract**: *With the rapid advancement of diffusion-based generative models, portrait image animation has achieved remarkable results. However, it still faces challenges in temporally consistent video generation and fast sampling due to its iterative sampling nature. This paper presents FLOAT, an audio-driven talking portrait video generation method based on flow matching generative model. Instead of a pixel-based latent space, we take advantage of a learned orthogonal motion latent space, enabling efficient generation and editing of temporally consistent motion. To achieve this, we introduce a transformer-based vector field predictor with an effective frame-wise conditioning mechanism. Additionally, our method supports speech-driven emotion enhancement, enabling a natural incorporation of expressive motions. Extensive experiments demonstrate that our method outperforms state-of-the-art audio-driven talking portrait methods in terms of visual quality, motion fidelity, and efficiency.*
12
+
13
+ **TL:DR: FLOAT is a flow matching based audio-driven talking portrait video generation method, which can enhance the speech-driven emotional motion.**
14
+
15
+ ## Generation Results
16
+
17
+ | Result 1 | Result 2 |
18
+ |---------------|---------|
19
+ | <video src="https://github.com/user-attachments/assets/8c00274d-795d-4ee9-870f-84a859f3e23f"> </video> | <video src="https://github.com/user-attachments/assets/c6e142b3-519b-4cda-b26d-e088414b478d"> </video> |
20
+
21
+ | Result 3 | Result 4 |
22
+ |--------|-----------|
23
+ | <video src="https://github.com/user-attachments/assets/7b201a5f-a293-46cd-974f-0612062d8d94"> </video> | <video src="https://github.com/user-attachments/assets/dd4b74dd-40b4-4864-b87d-7cbf4f0d66da"> </video> |
24
+
25
+ <br>
26
+ Our method runs faster than current diffusion-based methods with fewer sampling steps and lower memory cost. For more details, please refer to the paper.
27
+ <div align='center'>
28
+ <image width= 80% src="./assets/fps.png"> </image>
29
+ </div>
30
+
31
+
32
+
33
+ ## Updates
34
+ - [2025.06.26] ๐ŸŽ‰๐ŸŽ‰ FLOAT is accepted to **[ICCV 2025](https://iccv.thecvf.com)** ๐ŸŽ‰๐ŸŽ‰
35
+ - [2025.02.17] The inference code and checkpoints are released under a **[Non-commercial License](https://creativecommons.org/licenses/by-nc-nd/4.0/)**
36
+ - [2024.12.03] Selected as a [HuggingFace Daily Papers](https://huggingface.co/papers?date=2024-12-03) on December 3, 2024
37
+ - [2024.12.02] The paper is publicly available on [ArXiv](https://arxiv.org/abs/2412.01064)
38
+
39
+
40
+ ## Getting Started
41
+ ### Requirements
42
+ ```.bash
43
+ # 1. Create Conda Environment
44
+ conda create -n FLOAT python=3.8.5
45
+ conda activate FLOAT
46
+
47
+ # 2. Install torch and requirements
48
+ sh environments.sh
49
+
50
+ # or manual installation
51
+ pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
52
+ pip install -r requirements.txt
53
+ ```
54
+ - Test on Linux, A100 GPU, and V100 GPU.
55
+
56
+ ### Preparing checkpoints
57
+
58
+ 1. Download checkpints automatically
59
+
60
+ ```.bash
61
+ sh download_checkpoints.sh
62
+ ```
63
+
64
+ or download checkpoints manually from this [google-drive](https://drive.google.com/file/d/1rvWuM12cyvNvBQNCLmG4Fr2L1rpjQBF0/view?usp=sharing).
65
+
66
+ 2. The checkpoints should be organized as follows:
67
+ ```.bash
68
+ ./checkpints
69
+ |-- checkpoints_here
70
+ |-- float.pth # main model
71
+ |-- wav2vec2-base-960h/ # audio encoder
72
+ | |-- .gitattributes
73
+ | |-- config.json
74
+ | |-- feature_extractor_config.json
75
+ | |-- model.safetensors
76
+ | |-- preprocessor_config.json
77
+ | |-- pytorch_model.bin
78
+ | |-- README.md
79
+ | |-- special_tokens_map.json
80
+ | |-- tf_model.h5
81
+ | |-- tokenizer_config.json
82
+ | '-- vocab.json
83
+ '-- wav2vec-english-speech-emotion-recognition/ # emotion encoder
84
+ |-- .gitattributes
85
+ |-- config.json
86
+ |-- preprocessor_config.json
87
+ |-- pytorch_model.bin
88
+ |-- README.md
89
+ '-- training_args.bin
90
+ ```
91
+ - W2V based models could be found in the links: [wav2vec2-base-960h](https://huggingface.co/facebook/wav2vec2-base-960h) and [wav2vec-english-speech-emotion-recognition](https://huggingface.co/r-f/wav2vec-english-speech-emotion-recognition).
92
+
93
+
94
+ ### Generating Talking Portait Video from Single Image and Audio
95
+ 1. Pre-process;โ— **Important** โ— for better quality. Please read this.
96
+ - FLOAT is trained on the frontal head pose distributions. Non-frontal image may lead to suboptimal results.
97
+ - The performance of taking portrait methods often depends on their training preprocess strategies, e.g., the field-of-view. The inference code includes an automatic face-cropping function, which may involve black **padding** regions. You can manually disable the cropping process in `generate.py`, however it may lead to suboptimal performance.
98
+ - If your audio contains heavy background music, please use [ClearVoice](https://github.com/modelscope/ClearerVoice-Studio) to extract the vocals for better performance.
99
+
100
+
101
+ 1. Generating video 1 (Emotion from Audio)
102
+
103
+ You can generate a video with an emotion from audio without specifying `--emo`. You can adjust the intensity of the emotion using `--e_cfg_scale` (default 1). For more emotion intensive video, try large value from 5 to 10 for `--e_cfg_scale`.
104
+ ```.bash
105
+ CUDA_VISIBLE_DEVICES=0 python generate.py
106
+ --ref_path path/to/reference/image \
107
+ --aud_path path/to/audio \
108
+ --seed 15 \
109
+ --a_cfg_scale 2 \
110
+ --e_cfg_scale 1 \
111
+ --ckpt_path ./checkpoints/float.pth
112
+ --no_crop # [optional] skip cropping
113
+ ```
114
+
115
+ 2. Generate video 2 (Redirecting Emotion)
116
+ You can generate a video of other emotion by specifying `--emo`. It supports seven basic emotions: ['angry', 'disgust', 'fear', 'happy', 'neutral', 'sad', 'surprise']. You can adjust the intensity of the emotion using `--e_cfg_scale` (default 1). For more emotion intensive video, try large value from 5 to 10 for `--e_cfg_scale`.
117
+ ```.bash
118
+ CUDA_VISIBLE_DEVICES=0 python generate.py\
119
+ --ref_path path/to/reference/image \
120
+ --aud_path path/to/audio \
121
+ --emo 'happy' \ # Seven emotions ['angry', 'disgust', 'fear', 'happy', 'neutral', 'sad', 'surprise']
122
+ --seed 15 \
123
+ --a_cfg_scale 2 \
124
+ --e_cfg_scale 1 \
125
+ --ckpt_path ./checkpoints/float.pth \
126
+ --no_crop # [optional] skip cropping
127
+ ```
128
+
129
+ <video src="https://github.com/user-attachments/assets/fb3826cd-231b-46f2-809b-11adebe9a1cf"> </video>
130
+
131
+
132
+ 3. Running example and results
133
+ ```.bash
134
+ CUDA_VISIBLE_DEVICES=0 python generate.py \
135
+ --ref_path assets/sam_altman.webp \
136
+ --aud_path assets/aud-sample-vs-1.wav \
137
+ --seed 15 \
138
+ --a_cfg_scale 2 \
139
+ --e_cfg_scale 1 \
140
+ --ckpt_path ./checkpoints/float.pth
141
+ ```
142
+
143
+
144
+ | Before Crop | After Crop | Result |
145
+ |---------------|---------|--------|
146
+ | ![](assets/sam_altman.webp) | ![](assets/sam_altman_512x512.jpg) | <video src='https://github.com/user-attachments/assets/3353e4e0-00f5-429b-bc66-5db9a72186b8'> </video> |
147
+
148
+ <br>
149
+
150
+ ## โ—Licenseโ—
151
+ This work is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/). You may not use this work for commercial purposes and may use it only for research purposes. **For any commercial inquiries or collaboration opportunities**, please contact daniel@deepbrain.io.
152
+
153
+
154
+ ## Development
155
+ This repository is a research demonstration implementation and is provided as a one-time code drop. For any research-related inquiries, please contact the first author [Taekyung Ki](https://github.com/TaekyungKi). This work was done during the first author's South Korean Alternative Military Service at DeepBrain AI. This repository includes only the inference code; the training code will not be released.
156
+
157
+ ## Citation
158
+ ```bibtex
159
+ @inproceedings{ki2025float,
160
+ title={Float: Generative motion latent flow matching for audio-driven talking portrait},
161
+ author={Ki, Taekyung and Min, Dongchan and Chae, Gyeongsu},
162
+ booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
163
+ pages={14699--14710},
164
+ year={2025}
165
+ }
166
+ ```
167
+
168
+ ## Related Works
169
+ - [StyleLipSync: Style-based Personalized Lip-sync Video Generation](https://arxiv.org/abs/2305.00521)<br>
170
+ - [StyleTalker: One-shot Style-based Audo-driven Talking Head Video Generation](https://arxiv.org/abs/2208.10922)<br>
171
+ - [Export3D: Learning to Generate Conditional Tri-plane for 3D-aware Expression Controllable Portrait Animation](https://arxiv.org/abs/2404.00636)<br>
172
+ - [Latent Image Animator: Learning to Animate Images via Latent Space Navigation](https://arxiv.org/abs/2203.09043)<br>
173
+
174
+ ## Acknowledgements
175
+
176
+ The source images and audio are collected from the internet and other baselines, such as LIA, SadTalker, EMO, VASA-1, Hallo, LivePortrait, Loopy, and others. We appreciate their valuable contributions to this field. We employ Wav2Vec2.0-based speech emotion recognizer by [Rob Field](https://huggingface.co/r-f/wav2vec-english-speech-emotion-recognition). We appreciate this good work.