SadTalker 安装笔记

环境

  • 阿里云PAI-DSW
  • ubuntu20.04
  • pytorch:1.12
  • gpu-cu113
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
git clone https://github.com/OpenTalker/SadTalker.git

cd SadTalker

conda create -n sadtalker python=3.8

conda activate sadtalker

conda info

# 把 pip 源设为腾讯源
pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple

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

# cpu 版
# pip --default-timeout=1000 install torch==1.12.1+cpu torchvision==0.13.1+cpu torchaudio==0.12.1 -f https://download.pytorch.org/whl/torch_stable.html

conda install ffmpeg

pip install -r requirements.txt

### Coqui TTS is optional for gradio demo.
### pip install TTS

# 下载模型

python inference.py
–driven_audio ../ds1.wav
–source_image ../2.jpg
–enhancer gfpgan
–preprocess full
–still

python inference.py –driven_audio test/ds1.wav –source_image test/1.jpg –enhancer gfpgan –cpu

3D 版

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
git clone https://github.com/OpenTalker/SadTalker.git
cd SadTalker
conda create -n sadtalker3d python=3.8
source activate sadtalker3d

conda install ffmpeg
pip install fvcore iopath
conda install libgcc gmp

pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113

# insintall pytorch3d
pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1110/download.html

pip install -r requirements3d.txt

### install gpfgan for enhancer
pip install git+https://github.com/TencentARC/GFPGAN


### when occurs gcc version problem `from pytorch import _C` from pytorch3d, add the anaconda path to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/$YOUR_ANACONDA_PATH/lib/

python inference.py \
--driven_audio ../yiyi-tts.wav \
--source_image ../3.jpg \
--still \
--preprocess full \
--enhancer gfpgan

作者

CoderPan

发布于

2024-03-16

更新于

2024-11-17

许可协议

评论