Deep-Live-Cam-实时换脸开源部署和使用
提升观众体验
- 新奇与趣味:实时换脸能将主播的脸实时替换成各种动漫角色或奇幻形象。例如,直播游戏时,瞬间变成热门动漫角色进行游戏解说,这种奇特的视觉效果会让观众眼前一亮,增加直播的趣味性和吸引力,使观众更容易沉浸在直播内容中。
开源项目介绍
直播试试替换任意脸
安装方法
项目地址:GitHub Pages | Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.
运行环境安装 pip install -r requirements.txt
国内镜像地址
GitCode - 全球开发者的开源社区,开源代码托管平台GitCode是面向全球开发者的开源社区,包括原创博客,开源代码托管,代码协作,项目管理等。与开发者社区互动,提升您的研发效率和质量。https://gitcode.com/gh_mirrors/de/Deep-Live-Cam
国内模型镜像
inswapper_128_fp16.onnx
https://dl.aifasthub.com/datasets/Gourieff/ReActor/tree/main/models
GFPGANv1.4
Neus/GFPGANv1.4 at main
GPU加速
* In case something goes wrong and you need to reinstall the virtual environment **
# Deactivate the virtual environment
rm -rf venv# Reinstall the virtual environment
python -m venv venv
source venv/bin/activate# install the dependencies again
pip install -r requirements.txt
Run: If you don't have a GPU, you can run Deep-Live-Cam using python run.py
. Note that initial execution will download models (~300MB).
GPU Acceleration
CUDA Execution Provider (Nvidia)
- Install CUDA Toolkit 11.8.0
- Install dependencies:
pip uninstall onnxruntime onnxruntime-gpu
pip install onnxruntime-gpu==1.16.3
- Usage:
python run.py --execution-provider cuda
CoreML Execution Provider (Apple Silicon)
Apple Silicon (M1/M2/M3) specific installation:
- Make sure you've completed the macOS setup above using Python 3.10.
- Install dependencies:
pip uninstall onnxruntime onnxruntime-silicon
pip install onnxruntime-silicon==1.13.1
- Usage (important: specify Python 3.10):
python3.10 run.py --execution-provider coreml
使用方法
首次运行会自动下载一些模型。程序启动后,按界面指示选择源图片与目标图像/视频,点击开始即可。对于实时摄像头模式,只需选择脸孔并等待预览。