Windows通過WSL2快速部署sadtalker打造數(shù)字虛擬人
一、安裝環(huán)境
視頻地址:https://www.bilibili.com/video/BV1zj411m7Mt
1.安裝NVIDIA顯卡驅(qū)動(dòng),瀏覽器訪問
https://www.nvidia.cn/Download/index.aspx?lang=cn,選擇自己的顯卡型號(hào)下載驅(qū)動(dòng),下載后安裝好驅(qū)動(dòng)程序
2.管理員身份運(yùn)行命令提示符

輸入:wsl --install -d Ubuntu

重啟電腦,重啟后會(huì)自動(dòng)跳出窗口完成安裝ubuntu,安裝完畢會(huì)提示創(chuàng)建用戶和密碼

3.更新系統(tǒng)
sudo su
apt update
apt upgrade
apt-key del 7fa2af80

4.獲取docker的key
apt-get install ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg

5.生成倉庫信息
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

6.安裝docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

7.安裝CUDA
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-wsl-ubuntu-12-1-local_12.1.1-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-12-1-local_12.1.1-1_amd64.deb
sudo cp /var/cuda-repo-wsl-ubuntu-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

8.安裝容器工具包
touch /etc/docker/daemon.json
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get -y install nvidia-container-toolkit

9.重啟docker
service docker stop
service docker start

10.驗(yàn)證docker與nvida容器工具包是否整合成功
docker run --rm --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi

二、部署sadtalker
視頻地址:https://www.bilibili.com/video/BV1Vs4y1k7vK
1.切換到root用戶
sudo su
2.拉取我封裝好的鏡像(因?yàn)锳I的模型比較大,所以鏡像也比較大,如果拉取失敗可以多重試幾次,或者等到網(wǎng)絡(luò)低峰時(shí)段執(zhí)行拉?。?/p>
docker pull bucess/sadtalker:1

3.創(chuàng)建sadtalker
docker run -d --name sadtalker --gpus all --network host bucess/sadtalker:1

4.瀏覽器訪問localhost:7860,上傳準(zhǔn)備好的照片和音頻,勾選臉部加強(qiáng),點(diǎn)擊生成按鈕,AI就會(huì)用音頻驅(qū)動(dòng)照片說話,并生成視頻

生成后點(diǎn)擊播放按鈕就可以觀看合成效果了,

建議大家對(duì)照著視頻教程(??https://www.bilibili.com/video/BV1zj411m7Mt? ??https://www.bilibili.com/video/BV1Vs4y1k7vK??)進(jìn)行安裝部署。有了WSL2這個(gè)環(huán)境,大家就可以參看我分享的其他視頻,在windows中快速部署我封裝的其他AI項(xiàng)目進(jìn)行體驗(yàn)了。