A streaming digital human based on the Ernerf model, realize audio video synchronous dialogue. It can basically achieve commercial effects.
基于ernerf模型的流式数字人,实现音视频同步对话。基本可以达到商用效果
Tested on Ubuntu 20.04, Python3.10, Pytorch 1.12 and CUDA 11.3
conda create -n nerfstream python=3.10
conda install pytorch==1.12.1 torchvision==0.13.1 cudatoolkit=11.3 -c pytorch
conda activate nerfstream
pip install -r requirements.txt
pip install "git+https://github.com/facebookresearch/pytorch3d.git"
pip install tensorflow-gpu==2.8.0
linux cuda环境搭建可以参考这篇文章 https://zhuanlan.zhihu.com/p/674972886
参照 https://github.com/lipku/python_rtmpstream
docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5
python app.py
如果访问不了huggingface,在运行前
export HF_ENDPOINT=https://hf-mirror.com
运行成功后,用vlc访问rtmp://serverip/live/livestream
安装并启动nginx
apt install nginx
nginx
将echo.html和mpegts-1.7.3.min.js拷到/var/www/html下
用浏览器打开http://serverip/echo.html, 在文本框输入任意文字,提交。数字人播报该段文字
目前借鉴数字人对话系统LinlyTalker的方式,LLM模型支持Chatgpt,Qwen和GeminiPro。需要在app.py中填入自己的api_key。
安装并启动nginx,将chat.html和mpegts-1.7.3.min.js拷到/var/www/html下
用浏览器打开http://serverip/chat.html
运行xtts服务,参照 https://github.com/coqui-ai/xtts-streaming-server
docker run --gpus=all -e COQUI_TOS_AGREED=1 --rm -p 9000:80 ghcr.io/coqui-ai/xtts-streaming-server:latest
然后运行,其中ref.wav为需要克隆的声音文件
python app.py --tts xtts --ref_file data/ref.wav
不需要第1步的安装,直接运行。
docker run --gpus all -it --network=host --rm registry.cn-hangzhou.aliyuncs.com/lipku/nerfstream:v1.3
srs和nginx的运行同2.1和2.3
可以替换成自己训练的模型(https://github.com/Fictionarry/ER-NeRF)
.
├── data
│ ├── data_kf.json
│ ├── au.csv
│ ├── pretrained
│ └── └── ngp_kf.pth
docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 registry.cn-hangzhou.aliyuncs.com/lipku/srs:v1.1
如果本项目对你有帮助,帮忙点个star。也欢迎感兴趣的朋友一起来完善该项目。
Email: lipku@foxmail.com
微信公众号:数字人技术
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。