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.
 
 
 
 
lipku 275af1ed9e fix edgetts exception 11 months ago
assets update readme 1 year ago
autodl improve musetalk infer speed 1 year ago
data add wav2lip customvideo 12 months ago
ernerf resolve building errors 11 months ago
funasr fix gpt_voits 1 year ago
llm add wav2lip customvideo 12 months ago
models add musetalk 1 year ago
musetalk load fullbody image to memory 11 months ago
tts fix gpt-sovits 1 year ago
wav2lip add wav2lip stream 1 year ago
web add video record 11 months ago
.gitignore add 1 year ago
Dockerfile add docker 2 years ago
LICENSE Update LICENSE 12 months ago
README.md update readme 11 months ago
app.py fix edgetts exception 11 months ago
baseasr.py add wav2lip customvideo 12 months ago
basereal.py fix edgetts exception 11 months ago
lipasr.py wrapper class baseasr; add talk interrupt 1 year ago
lipreal.py add video record 11 months ago
museasr.py fix customvideo 12 months ago
musereal.py add video record 11 months ago
nerfasr.py fix customvideo 12 months ago
nerfreal.py load fullbody image to memory 11 months ago
requirements.txt load fullbody image to memory 11 months ago
ttsreal.py fix edgetts exception 11 months ago
webrtc.py improve musetalk lipsync and speed 1 year ago

README.md

Real time interactive streaming digital human realize audio video synchronous dialogue. It can basically achieve commercial effects.
实时交互流式数字人,实现音视频同步对话。基本可以达到商用效果

ernerf效果 musetalk效果 wav2lip效果

Features

  1. 支持多种数字人模型: ernerf、musetalk、wav2lip
  2. 支持声音克隆
  3. 支持数字人说话被打断
  4. 支持全身视频拼接
  5. 支持rtmp和webrtc
  6. 支持视频编排:不说话时播放自定义视频

1. Installation

Tested on Ubuntu 20.04, Python3.10, Pytorch 1.12 and CUDA 11.3

1.1 Install dependency

conda create -n nerfstream python=3.10
conda activate nerfstream
conda install pytorch==1.12.1 torchvision==0.13.1 cudatoolkit=11.3 -c pytorch
pip install -r requirements.txt
#如果只用musetalk或者wav2lip模型不需要安装下面的库
pip install "git+https://github.com/facebookresearch/pytorch3d.git"
pip install tensorflow-gpu==2.8.0
pip install --upgrade "protobuf<=3.20.1"

如果用pytorch2.1torchvision用0.16可以去torchvision官网根据pytorch版本找匹配的,cudatoolkit可以不用装
安装常见问题FAQ
linux cuda环境搭建可以参考这篇文章 https://zhuanlan.zhihu.com/p/674972886

2. Quick Start

默认采用ernerf模型webrtc推流到srs

2.1 运行srs

export CANDIDATE='<服务器外网ip>'
docker run --rm --env CANDIDATE=$CANDIDATE \
  -p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp \
  registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5 \
  objs/srs -c conf/rtc.conf

2.2 启动数字人:

python app.py

如果访问不了huggingface在运行前

export HF_ENDPOINT=https://hf-mirror.com

用浏览器打开http://serverip:8010/rtcpushapi.html, 在文本框输入任意文字,提交。数字人播报该段文字
备注:服务端需要开放端口 tcp:8000,8010,1985; udp:8000

3. More Usage

使用说明: https://livetalking-doc.readthedocs.io/

4. Docker Run

不需要前面的安装,直接运行。

docker run --gpus all -it --network=host --rm registry.cn-beijing.aliyuncs.com/codewithgpu2/lipku-metahuman-stream:vjo1Y6NJ3N

代码在/root/metahuman-stream先git pull拉一下最新代码然后执行命令同第2、3步

提供如下镜像

nginx
cd ~/srs/trunk
./objs/srs -c conf/rtc.tcp.udp.conf
cd ~/metahuman-stream
python app.py 

浏览器打开http:<haoee公网访问地址>/rtcpushapi.htmlhttp://www.haoee.com:25232/rtcpushapi.html

5. 性能分析

  1. 帧率
    在Tesla T4显卡上测试整体fps为18左右如果去掉音视频编码推流帧率在20左右。用4090显卡可以达到40多帧/秒。
    优化:新开一个线程运行音视频编码推流
  2. 延时
    整体延时3s左右
    1tts延时1.7s左右目前用的edgetts需要将每句话转完后一次性输入可以优化tts改成流式输入
    2wav2vec延时0.4s需要缓存18帧音频做计算 3srs转发延时设置srs服务器减少缓冲延时。具体配置可看 https://ossrs.net/lts/zh-cn/docs/v5/doc/low-latency

6. TODO

  • 添加chatgpt实现数字人对话
  • 声音克隆
  • 数字人静音时用一段视频代替
  • MuseTalk
  • Wav2Lip
  • TalkingGaussian

如果本项目对你有帮助帮忙点个star。也欢迎感兴趣的朋友一起来完善该项目.

  • 知识星球: https://t.zsxq.com/7NMyO 沉淀高质量常见问题、最佳实践经验、问题解答
  • 微信公众号:数字人技术