You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
6.2 KiB
Markdown

[English](./README-EN.md) | 中文版
实时交互流式数字人,实现音视频同步对话。基本可以达到商用效果
[wav2lip效果](https://www.bilibili.com/video/BV1scwBeyELA/) | [ernerf效果](https://www.bilibili.com/video/BV1G1421z73r/) | [musetalk效果](https://www.bilibili.com/video/BV1gm421N7vQ/)
国内镜像地址:<https://gitee.com/lipku/LiveTalking>
2 years ago
## 为避免与3d数字人混淆原项目metahuman-stream改名为livetalking原有链接地址继续可用
10 months ago
## News
- 2024.12.8 完善多并发,显存不随并发数增加
- 2024.12.21 添加wav2lip、musetalk模型预热解决第一次推理卡顿问题。感谢[@heimaojinzhangyz](https://github.com/heimaojinzhangyz)
- 2024.12.28 添加数字人模型Ultralight-Digital-Human。 感谢[@lijihua2017](https://github.com/lijihua2017)
- 2025.2.7 添加fish-speech tts
- 2025.2.21 添加wav2lip256开源模型 感谢@不蠢不蠢
- 2025.3.2 添加腾讯语音合成服务
- 2025.3.16 支持mac gpu推理感谢[@GcsSloop](https://github.com/GcsSloop)
- 2025.5.1 精简运行参数ernerf模型移至git分支ernerf-rtmp
- 2025.6.7 添加虚拟摄像头输出
## Features
1. 支持多种数字人模型: ernerf、musetalk、wav2lip、Ultralight-Digital-Human
2. 支持声音克隆
3. 支持数字人说话被打断
4. 支持全身视频拼接
5. 支持webrtc、虚拟摄像头输出
6. 支持动作编排:不说话时播放自定义视频
7. 支持多并发
2 years ago
## 1. Installation
2 years ago
Tested on Ubuntu 24.04, Python3.10, Pytorch 2.5.0 and CUDA 12.4
2 years ago
2 years ago
### 1.1 Install dependency
2 years ago
```bash
2 years ago
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
2 years ago
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"
7 months ago
```
安装常见问题[FAQ](https://livetalking-doc.readthedocs.io/zh-cn/latest/faq.html)
linux cuda环境搭建可以参考这篇文章 <https://zhuanlan.zhihu.com/p/674972886>
视频连不上解决方法 <https://mp.weixin.qq.com/s/MVUkxxhV2cgMMHalphr2cg>
2 years ago
## 2. Quick Start
- 下载模型
夸克云盘<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
<font color=red>服务端需要开放端口 tcp:8010; udp:1-65536 </font>
客户端可以选用以下两种方式:
(1)用浏览器打开http://serverip:8010/webrtcapi.html , 先点start',播放数字人视频;然后在文本框输入任意文字,提交。数字人播报该段文字
(2)用客户端方式, 下载地址<https://pan.quark.cn/s/d7192d8ac19b>
5 months ago
- 快速体验
2 months ago
<https://www.compshare.cn/images/4458094e-a43d-45fe-9b57-de79253befe4?referral_code=3XW3852OBmnD089hMMrtuU&ytag=GPU_GitHub_livetalking> 用该镜像创建实例即可运行成功
2 years ago
如果访问不了huggingface在运行前
2 years ago
```
export HF_ENDPOINT=https://hf-mirror.com
6 months ago
```
2 years ago
## 3. More Usage
使用说明: <https://livetalking-doc.readthedocs.io/>
2 years ago
## 4. Docker Run
不需要前面的安装,直接运行。
2 years ago
```
5 months ago
docker run --gpus all -it --network=host --rm registry.cn-beijing.aliyuncs.com/codewithgpu2/lipku-metahuman-stream:2K9qaMBu8v
2 years ago
```
代码在/root/metahuman-stream先git pull拉一下最新代码然后执行命令同第2、3步
2 years ago
提供如下镜像
- autodl镜像: <https://www.codewithgpu.com/i/lipku/metahuman-stream/base>
[autodl教程](https://livetalking-doc.readthedocs.io/en/latest/autodl/README.html)
2 months ago
- ucloud镜像: <https://www.compshare.cn/images/4458094e-a43d-45fe-9b57-de79253befe4?referral_code=3XW3852OBmnD089hMMrtuU&ytag=GPU_GitHub_livetalking>
可以开放任意端口不需要另外部署srs服务.
[ucloud教程](https://livetalking-doc.readthedocs.io/en/latest/ucloud/ucloud.html)
2 years ago
## 5. 性能
- 性能主要跟cpu和gpu相关每路视频压缩需要消耗cpucpu性能与视频分辨率正相关每路口型推理跟gpu性能相关。
- 不说话时的并发数跟cpu相关同时说话的并发数跟gpu相关。
- 后端日志inferfps表示显卡推理帧率finalfps表示最终推流帧率。两者都要在25以上才能实时。如果inferfps在25以上finalfps达不到25表示cpu性能不足。
- 实时推理性能
模型 |显卡型号 |fps
:---- |:--- |:---
wav2lip256 | 3060 | 60
musetalk | 3080Ti | 45
wav2lip256 | 3080Ti | 120
2 months ago
wav2lip256显卡3060以上即可musetalk需要3080Ti以上。
## 6. 商业版
提供如下扩展功能,适用于对开源项目已经比较熟悉,需要扩展产品功能的用户
1. 高清wav2lip模型
2. 完全语音交互,数字人回答过程中支持通过唤醒词或者按钮打断提问
3. 实时同步字幕,给前端提供数字人每句话播报开始、结束事件
4. 每个连接可以指定对应avatar和音色avatar图片加载加速
5. 动作编排:不说话时动作、唤醒时动作、思考时动作、进入休眠动作
6. 支持不限时长的数字人形象avatar
7. 提供实时音频流输入接口
8. 数字人透明背景,能叠加动态背景
2 months ago
## 7. 声明
基于本项目开发并发布在B站、视频号、抖音等网站上的视频需带上LiveTalking水印和标识如需去除请联系作者备案授权。
2 years ago
---
如果本项目对你有帮助帮忙点个star。也欢迎感兴趣的朋友一起来完善该项目.
* 知识星球: https://t.zsxq.com/7NMyO 沉淀高质量常见问题、最佳实践经验、问题解答
* 微信公众号:数字人技术
![](https://mmbiz.qpic.cn/sz_mmbiz_jpg/l3ZibgueFiaeyfaiaLZGuMGQXnhLWxibpJUS2gfs8Dje6JuMY8zu2tVyU9n8Zx1yaNncvKHBMibX0ocehoITy5qQEZg/640?wxfrom=12&tp=wxpic&usePicPrefetch=1&wx_fmt=jpeg&amp;from=appmsg)