You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# SadTalker with GFPGAN 图像语音合成
SadTalker with GFPGAN 是一个图像和语音合成项目,它结合了 SadTalker 模型和 GFPGAN 图像增强技术,使用户能够通过图像和语音生成合成视频。
## 安装步骤
1. 下载 [Anaconda ](https://www.anaconda.com/products/distribution ) 并安装。
2. 设置 pip 源:
```bash
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
```
3. 进入 SadTalker 目录:
```bash
cd path/to/SadTalker
```
4. 创建并激活虚拟环境:
```bash
conda create -n sadtalker python=3.8
conda activate sadtalker
```
5. 安装 PyTorch 和其他依赖:
```bash
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
conda install ffmpeg
pip install -r requirements.txt
```
## 生成合成视频
执行以下命令生成合成视频:
```bash
# 确保将 path/to/your/audio.wav 替换为您的语音文件路径, path/to/your/image.png 替换为您的图像文件路径, path/to/output 替换为您的输出目录。
python inference.py --driven_audio path/to/your/audio.wav --source_image path/to/your/image.png --result_dir path/to/output --still --preprocess full --enhancer gfpgan
```
| 名称 | 配置 | 默认值 | 说明 |
|:-------------------|:----------------------|:-------------|:-----------------------------------------|
| 增强模式 | `--enhancer` | None | 使用 `gfpgan` 或 `RestoreFormer` 通过面部修复网络增强生成的面部 |
| 背景增强模式 | `--background_enhancer` | None | 使用 `realesrgan` 增强整个视频。 |
| 静态模式 | ` --still` | False | 使用与原始图像相同的姿势参数,减少头部运动。 |
| 表达模式 | `--expression_scale` | 1.0 | 较大的值将增强表情动作。 |
| 保存路径 | `--result_dir` | `./results` | 文件将保存在新的位置。 |
| 预处理模式 | `--preprocess` | `crop` | 在裁剪的输入图像上运行并生成结果。其他选择:`resize`,图像将被调整为特定分辨率。`full`,运行完整图像动画,与 `--still` 一起使用以获得更好的结果。|
| 参考模式 (眼部) | `--ref_eyeblink` | None | 视频路径,我们从该参考视频中借用眨眼动作以提供更自然的眉毛运动。|
| 参考模式 (姿势) | `--ref_pose` | None | 视频路径,我们从该头部参考视频中借用姿势。|
| 3D 模式 | `--face3dvis` | False | 需要额外的安装。有关生成3D人脸的更多详细信息, 请参见 [这里 ](docs/face3d.md )。|
| 自由视角模式 | `--input_yaw` ,< br > `--input_pitch` ,< br > `--input_roll` | None | 从单个图像生成新视角或自由视角的4D对话头。有关更多详细信息, 请参见 [这里 ](https://github.com/Winfredy/SadTalker#generating-4d-free-view-talking-examples-from-audio-and-a-single-image )。|