Step-by-step tutorial on how to install SadTalker

Tip: Yesterday I personally tested the SadTalker installation tutorial that worked. As for those who don’t know what SadTalker is, you can check it directly on github.


Preface

提示:软件准备工作:
Project source code: Baidu Netdisk
提示:如果对百度网盘的不放心也可以根据自己的需求去github下载
github project source code: https://github.com/Winfredy/SadTalker.git
Environment management software: Anaconda
Editor: Visual Studio Code


1. Start the installation

Some are basic installation requirements given by the project


配置环境:

pip源设置:

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

//这里默认是使用压缩的包的  随便把压缩包解压一下
先解压SadTalker安装包,从windows 菜单点击anaconda prompt,

进入命令行开始安装执行SadTalker安装命令:
cd SadTalker  

//创建一个 名称叫 sadtalker  的环境 他的python环境版本是3.8 
conda create -n sadtalker python=3.8  

//进入环境
conda activate sadtalker

//下载安装pytorch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

//安装ffmpeg
conda install ffmpeg

//下载安装默认的requirements.txt配置文件
pip install -r requirements.txt


查看当前虚拟环境的安装目录,执行命令:conda info

把源代码压缩包里面的:gfpgan\weights\GFPGANv1.4.pth 剪切到虚拟环境的 Lib\site-packages\gfpgan\weights 目录下



生成视频需要执行命令:
python inference.py --driven_audio e:\temp\sadtalker\speech_0.wav --source_image e:\temp\sadtalker\1.png --result_dir e:\temp\sadtalker --still --preprocess full --enhancer gfpgan


e:\temp\sadtalker\speech_0.wav 替换成 你的语音文件

e:\temp\sadtalker\1.png 替换从你的图片

e:\temp\sadtalker 替换成你的输出目录

Detailed reference video

Guess you like

Origin blog.csdn.net/qq_40750573/article/details/130155096