【DreamTalk】源码部署

安装

# 下载源码
git clone https://github.com/ali-vilab/dreamtalk
cd dreamtalk

conda create -n dreamtalk python=3.10
conda activate dreamtalk

conda install -c conda-forge yacs==0.1.8
conda install -c conda-forge numpy==1.21.5
conda install -c conda-forge av==10.0.0
conda install ffmpeg

# 修改requirements.txt中opencv-python的版本: opencv-python==4.9.0.80
pip install -r requirements.txt

# CPU版
# conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 cpuonly -c pytorch
# GPU版(https://pytorch.org/get-started/locally/)
conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=11.8 -c pytorch -c nvidia

pip install urllib3==1.26.6
pip install transformers==4.28.1
conda install -c conda-forge dlib
pip install chardet
conda install -c conda-forge blas

模型下载

下载到dreamtalk/checkpoints目录

  • https://modelscope.cn/api/v1/models/iic/dreamtalk/repo?Revision=master&FilePath=checkpoints/denoising_network.pth
  • https://modelscope.cn/api/v1/models/iic/dreamtalk/repo?Revision=master&FilePath=checkpoints/renderer.pt

下载到dreamtalk/AI-ModelScope

cd dreamtalk/AI-ModelScope
git clone https://www.modelscope.cn/AI-ModelScope/wav2vec2-large-xlsr-53-english.git

修改inference_for_demo_video.py

WAV2VEC_MODEL_PATH = "/xxxx/dreamtalk/AI-ModelScope/wav2vec2-large-xlsr-53-english"

...

# get wav2vec feat from audio
wav2vec_processor = Wav2Vec2Processor.from_pretrained(WAV2VEC_MODEL_PATH)

wav2vec_model = (
    Wav2Vec2Model.from_pretrained(WAV2VEC_MODEL_PATH)
    .eval()
    .to(device)
)

测试验证

GPU运行

python inference_for_demo_video.py \
--wav_path /vxiao/funasr-runtime-resources/models/output.wav \
--style_clip_path data/style_clip/3DMM/M030_front_neutral_level1_001.mat \
--pose_path data/pose/RichardShelby_front_neutral_level1_001.mat \
--image_path /vxiao/SadTalker/examples/source_image/art_5.png \
--cfg_scale 1.0 \
--max_gen_len 30 \
--output_name test01

运行结果

在这里插入图片描述

  • 耗时29秒

CPU运行

python inference_for_demo_video.py \
--wav_path /vxiao/funasr-runtime-resources/models/output.wav \
--style_clip_path data/style_clip/3DMM/M030_front_neutral_level1_001.mat \
--pose_path data/pose/RichardShelby_front_neutral_level1_001.mat \
--image_path /vxiao/SadTalker/examples/source_image/art_5.png \
--cfg_scale 1.0 \
--max_gen_len 30 \
--device cpu \
--output_name test01

运行结果

在这里插入图片描述

  • 耗时176s

部署过程遇到的问题&处理

No CMAKE_CXX_COMPILER could be found

yum install gcc gcc-c++

ImportError: liblapack.so.3: cannot open shared object file: No such file or directory

yum install lapack-devel

参考资料

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

太空眼睛

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值