DH_live教程

命令行版本

例如我的cuda 版本是12.2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
PS D:\BaiduNetdiskDownload\DH_live-main\DH_live-main> nvidia-smi
Sun Sep 8 14:26:59 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 538.59 Driver Version: 538.59 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce MX330 WDDM | 00000000:2D:00.0 Off | N/A |
| N/A 50C P0 N/A / ERR! | 0MiB / 2048MiB | 2% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+


安装cuda对应版本torch

1
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

python data_preparation.py YOUR_VIDEO_PATH

音频转换

1
python demo.py video_data/4847f6ed-6dc5-11ef-a6b7-ac8247d6cb43 .\video_data\ma.wav 7.mp4

ComfyUI版本

1
2
3
4
# in ComfyUI/custom_nodes
git clone https://github.com/AIFSH/DHLive-ComfyUI.git
cd DHLive-ComfyUI
pip install -r requirements.txt

(121858,) 7.616125

(927744, 2) 57.984

File “D:\BaiduNetdiskDownload\DH_live-main\DH_live-main\talkingface\audio_model.py”, line 103, in interface_wav
fbank.accept_waveform(16000, augmented_samples2.tolist())
TypeError: accept_waveform(): incompatible function arguments. The following argument types are supported:

1. (self: _kaldi_native_fbank.OnlineFbank, sampling_rate: float, waveform: List[float]) -> None

尝试使用ffmpeg方法如下:

方法一:

ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4

点评:该方法虽然体积更小,但是微信内置的解码器并不能支持正常播放,发送给收信方之后,视频将只有音频。

方法二:
什么都不用,就用ffmpeg默认的参数进行转码:

ffmpeg -i input.mp4 output.mp4

虽然很没有道理,但是体积也奇迹般地缩小了,可以正常被微信接收并播放。

cuda版本不匹配问题

How to install pytorch with CUDA support with pip

followed the main instructions for installing on pytorch’s site but still failed to have success. For my setup this resulted in .pip3 install torch torchvision torchaudio –index-url https://download.pytorch.org/whl/cu117

I had to add which finally fixed the problem.–upgrade –force-reinstall

2024最新最强数字人实时驱动方案——DH_live 部署教程

https://blog.csdn.net/qq_34717531/article/details/141065146


DH_live教程
http://witbit.cn/LIVE/DH_live教程.html
作者
朝彻
发布于
2025年2月13日
许可协议