Tip: The installation package download time for this article is 2023-8-15. The project is still being updated and there may be discrepancies. It is for your reference only.
Article directory
Preparation
提示:先下载好项目预先需要各种安装包与预训练模型
软件使用:Anaconda 负责python环境管理
编辑器:Visual Studio Code(因为低版本的PyCharm 编辑器不支持python3版本)
预训练模型:https://github.com/OpenTalker/video-retalking/releases/tag/v0.0.1
注意:如果你跟我一样家庭网速感人,可以考虑使用: https://ghproxy.com/ 加速代理 则可以加速下载包的速度 例如地址:https://ghproxy.com/https://github.com/***/***.zip 这种用法,可以加速下载预训练安装包
1. Start configuration
Create select a disk then a folder
//使用git 拉取 代码
git clone https://kgithub.com/vinthony/video-retalking.git
//代码拉取完成之后打开video-retalking文件夹
These are the pre-trained models
Add the pre-trained model to: checkpoints folder
2. canda environment configuration
1. Create an environment
// conda 创建一个名叫:videoing的环境,并且该环境的py版本为3.8
conda create -n videoing python=3.8
//激活python的环境 输入环境的名称
conda activate videoing
The author's environment and mirror source (for reference only)
This is the author's mirror source:
The following are the packages installed in the author's environment for your reference.
主要:以上是作者完成所有环境配置后的包的列表,可以供大家参考
2. Installation environment
// conda 下载 ffmpeg
conda install ffmpeg
// 警告!!! 下载火炬驱动因为训练需要驱动GPU 这个要根据自己的GPU版本来进行微调 切记擅自下载调用
# Please follow the instructions from https://pytorch.org/get-started/previous-versions/
# This installation command only works on CUDA 11.1
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
Configure your own torch method
Tip: This tutorial defaults to the N card tutorial, and I have never touched the A card.
Installation: pytorch
//第一步:安装N卡驱动(某度查询)否则又要出教程了
//第二步:查询自己显卡适用的 版本
nvidia-smi
Various versions of pytorch
Download according to your own graphics card version
Continue to download the pre-packaged
注意:我不知道是包的问题还是我源版本的问题,反正下载了还是出了问题,故此这里做一个提示
// 下载系统预算的配置包
pip install -r requirements.txt
//这个是项目默认给的下载的包,但是根据git反馈说法貌似有问题
basicsr==1.4.2
kornia==0.5.1
face-alignment==1.3.4
ninja==1.10.2.3
einops==0.4.1
facexlib==0.2.5
librosa==0.9.2
dlib==19.24.0
gradio>=3.7.0
numpy==1.21.6
This is the content of the feedback on git.
注意:可以根据自己的需求进行选择,如果在运行过程中遇到 ModuleNotFoundError: No module named ‘****‘ 这个报错
The solution is:
pip3 install 这里填写模块 -i https://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
3. Start reasoning
There are two ways to do inference, one is the command line and the other is using the web method.
//这是命令行的方式进行启动
python inference.py --face examples/face/1.mp4 --audio examples/audio/1.wav --outfile results/1_3.mp4
Running status
The status of completing the operation
注意:推理步奏一共有6步,可万一报错,可以根据报错出现在哪一步,进入git寻找答案
Summarize
You can refer to these parameters here to adjust your own project.