Ubuntu如何部署AI-Sphere-Butler(metahuman-stream)

发布于:2025-03-25 ⋅ 阅读:(46) ⋅ 点赞:(0)

环境:

Ubuntu 20.04、22.04

Python3.10

Pytorch 1.12

CUDA 11.3

问题描述:

Ubuntu如何部署AI-Sphere-Butler(metahuman-stream(LiveTalking))

在这里插入图片描述

解决方案:

一、部署

本次部署以云服务器,拉取最新版互动数字人为例:metahuman-stream(LiveTalking)
在这里插入图片描述
二、下载安装Miniconda环境

1.打开终端,下载最新版本的 Miniconda 安装脚本(推荐使用 HTTPS 链接以确保安全)。

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

在这里插入图片描述2. 安装

运行下载的安装脚本,通过终端运行:

bash Miniconda3-latest-Linux-x86_64.sh

3.安装过程中的重要步骤:

按 Enter 接受许可证协议。
按 Ctrl + D 阅读完协议后确认接受。
默认安装路径是 ~/miniconda3,按 Enter 接受默认位置。

在这里插入图片描述
4.最后,安装程序会提示你是否初始化 Conda。对于大多数用户来说,可以直接输入 yes。
在这里插入图片描述
在这里插入图片描述5.初始化 Conda

安装完成后,运行以下命令以确保 Conda 环境变量生效:

source ~/.bashrc  # 或 source ~/.zshrc

在这里插入图片描述6.验证安装

运行以下命令验证 Conda 是否安装成功:

conda --version

如果安装成功,你会看到输出 Conda 的版本号。
在这里插入图片描述7.更新 Conda(备用)

如果你需要升级 Conda 到最新版本,可以运行:

conda update conda

三、部署新版metahuman-stream(LiveTalking)

1.安装

拉取源码

git clone https://github.com/lipku/LiveTalking.git

在这里插入图片描述不能克隆就手工上传

(base) root@dsw-873965-75dcfd74bb-lvdkx:/mnt/workspace# ls
AI-Sphere-Butler.zip  Miniconda3-latest-Linux-x86_64.sh
(base) root@dsw-873965-75dcfd74bb-lvdkx:/mnt/workspace# unzip AI-Sphere-Butler.zip
Archive:  AI-Sphere-Butler.zip
16c58f12b7a3294e9a1dc6188db0661a08193678
   creating: LiveTalking-main/
   creating: LiveTalking-main/.github/
 extracting: LiveTalking-main/.github/FUNDING.yml  
base) root@dsw-873965-75dcfd74bb-lvdkx:/mnt/workspace# mv LiveTalking-main AI-Sphere-Butler
(base) root@dsw-873965-75dcfd74bb-lvdkx:/mnt/workspace# ls
AI-Sphere-Butler  AI-Sphere-Butler.zip  Miniconda3-latest-Linux-x86_64.sh

(base) root@dsw-873965-75dcfd74bb-lvdkx:/mnt/workspace# cd AI-Sphere-Butler
(base) root@dsw-873965-75dcfd74bb-lvdkx:/mnt/workspace/AI-Sphere-Butler# 

2.安装相应依赖

conda create -n AISphereButler python=3.10
conda activate AISphereButler

退出虚拟环境命令:

deactivate

在这里插入图片描述如果cuda版本不为11.3(运行nvidia-smi确认版本),根据https://pytorch.org/get-started/previous-versions/安装对应版本的pytorch

conda install pytorch==1.12.1 torchvision==0.13.1 cudatoolkit=11.3 -c pytorch

在这里插入图片描述在这里插入图片描述3.继续安装依赖

pip install -r requirements.txt

在这里插入图片描述 4. 完成后,将s3fd.pth文件拷到本项目wav2lip/face_detection/detection/sfd/s3fd.pth
在这里插入图片描述
5.将wav2lip256.pth模型文件,复制到本项目的models下, 重命名为wav2lip.pth
在这里插入图片描述
6.将wav2lip256_avatar1.tar.gz解压后整个文件夹拷到本项目的data/avatars下(如果拉取我的metahuman-stream这些文件里面有文件)
在这里插入图片描述
7.运行python app

python app.py –transport webrtc –model wav2lip –avatar_id wav2lip256_avatar1

8.用浏览器打开

http://serverip:8010/webrtcapi.html
可以设置–batch_size 提高显卡利用率,设置–avatar_id 运行不同的数字人

9.将我这些项目下的相关文件复制到前面拉取最新的文件夹里面

AI-Sphere-Butler\metahuman-stream\web
metahuman-stream

运行命令

python app.py --transport webrtc --model wav2lip --avatar_id wav2lip_avatar1 --batch_size 4   --tts gpt-sovits --TTS_SERVER http://127.0.0.1:9881

用谷歌浏览器打开

https://127.0.0.1:8010/realtalk/examples/index.html

网站公告

今日签到

点亮在社区的每一天
去签到