English | 中文版
实时交互流式数字人,实现音视频同步对话。基本可以达到商用效果
wav2lip效果 | ernerf效果 | musetalk效果
国内镜像地址:https://gitee.com/lipku/LiveTalking
Tested on Ubuntu 24.04, Python3.10, Pytorch 2.5.0 and CUDA 12.4
conda create -n nerfstream python=3.10
conda activate nerfstream
#如果cuda版本不为12.4(运行nvidia-smi确认版本),根据<https://pytorch.org/get-started/previous-versions/>安装对应版本的pytorch
conda install pytorch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 pytorch-cuda=12.4 -c pytorch -c nvidia
pip install -r requirements.txt
#如果需要训练ernerf模型,安装下面的库
# pip install "git+https://github.com/facebookresearch/pytorch3d.git"
# pip install tensorflow-gpu==2.8.0
# pip install --upgrade "protobuf<=3.20.1"
安装常见问题FAQ
linux cuda环境搭建可以参考这篇文章 https://zhuanlan.zhihu.com/p/674972886
视频连不上解决方法 https://mp.weixin.qq.com/s/MVUkxxhV2cgMMHalphr2cg
下载模型
夸克云盘https://pan.quark.cn/s/83a750323ef0
GoogleDriver https://drive.google.com/drive/folders/1FOC_MD6wdogyyX_7V1d4NDIO7P9NlSAJ?usp=sharing
将wav2lip256.pth拷到本项目的models下, 重命名为wav2lip.pth;
将wav2lip256_avatar1.tar.gz解压后整个文件夹拷到本项目的data/avatars下
运行
python app.py --transport webrtc --model wav2lip --avatar_id wav2lip256_avatar1
服务端需要开放端口 tcp:8010; udp:1-65536
客户端可以选用以下两种方式:
(1)用浏览器打开http://serverip:8010/webrtcapi.html , 先点‘start',播放数字人视频;然后在文本框输入任意文字,提交。数字人播报该段文字
(2)用客户端方式, 下载地址https://pan.quark.cn/s/d7192d8ac19b
快速体验
https://www.compshare.cn/images/4458094e-a43d-45fe-9b57-de79253befe4?referral_code=3XW3852OBmnD089hMMrtuU&ytag=GPU_GitHub_livetalking 用该镜像创建实例即可运行成功
如果访问不了huggingface,在运行前
export HF_ENDPOINT=https://hf-mirror.com
使用说明: https://livetalking-doc.readthedocs.io/
不需要前面的安装,直接运行。
docker run --gpus all -it --network=host --rm registry.cn-beijing.aliyuncs.com/codewithgpu2/lipku-metahuman-stream:2K9qaMBu8v
代码在/root/metahuman-stream,先git pull拉一下最新代码,然后执行命令同第2、3步
提供如下镜像
| 模型 | 显卡型号 | fps |
|---|---|---|
| wav2lip256 | 3060 | 60 |
| musetalk | 3080Ti | 45 |
| wav2lip256 | 3080Ti | 120 |
wav2lip256显卡3060以上即可,musetalk需要3080Ti以上。
提供如下扩展功能,适用于对开源项目已经比较熟悉,需要扩展产品功能的用户
基于本项目开发并发布在B站、视频号、抖音等网站上的视频需带上LiveTalking水印和标识,如需去除请联系作者备案授权。
如果本项目对你有帮助,帮忙点个star。也欢迎感兴趣的朋友一起来完善该项目.