Instal Guide Overview
Sadtalker is a fully open-source talking avatar. This tutorial will lead you step by step through the process to install Sadtalker and running the software on your own computer. The guidance is very detailed; after personally installing it multiple times, I’ve compiled my own installation guide based on this experience. I hope it can assist those wishing to move away from the expensive generation credit required by paid platforms, allowing for the free, unrestricted creation of talking avatar animations on your own computer, with results comparable to those of paid platforms. All you need is a graphics card of average performance and some patience.
Table of Contents
Step 1 Install Anaconda
The Anaconda platform is an open-source project with two main functions. First, it provides a complete set of Python dependency packages for AI scientific computing, which eases the deployment of local AI applications without the hassle of complex dependencies. The second function is that the Anaconda platform can create a virtual environment for you, setting up a virtual environment for each separate project to keep them distinct from each other. You can think of it as each AI application having its own directory to host all the environmental dependencies required to run that AI application. This solves the problem of installing various versions of PYTHON and different versions of dependency packages when multiple AI applications are installed on the same computer. Believe me, once you use the Anaconda platform, you will love it.
Let’s do it.
First, you need to download Anaconda. The download link is https://www.anaconda.com
Begin installation
NEXT
Next, select “All Users”. If you do not have administrator rights on the machine, then choose “Just Me”
Next, select the installation path. Afterwards, when installing SadTalker, several large Python packages and models will be downloaded, so you will need to have 10GB of disk space available. Please be mindful of the space required
The third option, “Recovers some disk space without harming functionality,” allows the installer to optimize the installation process by removing certain unnecessary additional components, thereby reducing the disk space occupied after installation.
Start to Install
Installation complete
Open Anaconda Command Prompt window
If prompted to update, then choose yes
Before updating, you must choose to close the software, then select “Update Now”.
Wait for Anaconda to restart, Anaconda installation complete.
setp 2 Download and install sadtalker
Download Sadtalker https://github.com/OpenTalker/SadTalker
After downloading, extract it to a local folder. I placed it on the E drive and renamed it to SadTalker.
Open the Anaconda prompt window.
Switch to the downloaded SadTalker source code directory.
Create an Anaconda virtual environment called sadtalker and set the python version to 3.8
conda create -n sadtalker python=3.8
The installation process requires you to confirm the installation of these packages. When prompted, enter ‘Y’ to proceed. Once you see the following figure, the installation is complete.
Activate the SadTalker virtual environment. After activation, the prompt preceding will change to ‘sadtalker’, indicating that you have entered the SadTalker virtual environment.
Switch the pip library to Aliyun
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
Install PyTorch and related packages. The waiting time here might be relatively long since it involves downloading a few large Python packages. If there are no errors reported by the end of the installation, then it has been successful.
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 –extra-index-url https://download.pytorch.org/whl/cu113
Installation successful
now install sadtalker finished
Step 3 How to use sadtalker.
Activate the sadtalker virtual environment, switch to the sadtalker root directory, and run the following command.
E:\SadTalker>python inference.py –driven_audio e:\SadTalker\examples\driven_audio\bus_chinese.wav –source_image e:\SadTalker\examples\source_image\full_body_2.png –enhancer gfpgan
e:\SadTalker\examples\driven_audio\bus_chinese.wav (Place the audio files into this directory.)
e:\SadTalker\examples\source_image\full_body_2.png(Place the Video files into this directory.)
Step 4 Command parameter explanation.
python inference.py --driven_audio <audio.wav> --source_image <video.mp4 or picture.png> --result_dir <a file to store results> --still --preprocess full --enhancer gfpgan
Using--still
to generate a natural full body video. You can addenhancer
to improve the quality of the generated video.