commit 6dda9868f0a9871ea41cd0cae3961a5851a92313
Author: fanpt <320622572@qq.com>
Date: Tue Jan 23 13:47:31 2024 +0800
人物图片生成视频
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..885d034
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,167 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# poetry
+# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
+# This is especially recommended for binary packages to ensure reproducibility, and is more
+# commonly ignored for libraries.
+# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
+#poetry.lock
+
+# pdm
+# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+# in version control.
+# https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# PyCharm
+# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+# and can be added to the global gitignore or merged into this file. For a more nuclear
+# option (not recommended) you can uncomment the following to ignore the entire idea folder.
+#.idea/
+
+examples/results/*
+gfpgan/*
+checkpoints/
+results/*
+Dockerfile
+start_docker.sh
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..35410ca
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/SadTalker.iml b/.idea/SadTalker.iml
new file mode 100644
index 0000000..8b8c395
--- /dev/null
+++ b/.idea/SadTalker.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/deployment.xml b/.idea/deployment.xml
new file mode 100644
index 0000000..0fb5507
--- /dev/null
+++ b/.idea/deployment.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..46f11a4
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..cc49978
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..2669bbc
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..b2a615a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Tencent AI Lab
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README_CH.md b/README_CH.md
new file mode 100644
index 0000000..6007e75
--- /dev/null
+++ b/README_CH.md
@@ -0,0 +1,56 @@
+# 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`, `--input_pitch`, `--input_roll` | None | 从单个图像生成新视角或自由视角的4D对话头。有关更多详细信息,请参见 [这里](https://github.com/Winfredy/SadTalker#generating-4d-free-view-talking-examples-from-audio-and-a-single-image)。|
diff --git a/README_en.md b/README_en.md
new file mode 100644
index 0000000..7022e72
--- /dev/null
+++ b/README_en.md
@@ -0,0 +1,313 @@
+
+
+
+
+
+
+
+ [](https://colab.research.google.com/github/Winfredy/SadTalker/blob/main/quick_demo.ipynb) [](https://huggingface.co/spaces/vinthony/SadTalker)
+
+
+