Go to file
lihengzhong 51d36ea018 add demo video 2024-01-10 15:14:22 +08:00
assets add demo video 2024-01-10 15:06:08 +08:00
data git init 2023-12-20 17:30:25 +08:00
data_utils git init 2023-12-20 17:30:25 +08:00
freqencoder git init 2023-12-20 17:30:25 +08:00
gridencoder git init 2023-12-20 17:30:25 +08:00
nerf_triplane git init 2023-12-20 17:30:25 +08:00
raymarching git init 2023-12-20 17:30:25 +08:00
scripts git init 2023-12-20 17:30:25 +08:00
shencoder git init 2023-12-20 17:30:25 +08:00
.gitignore git init 2023-12-20 17:30:25 +08:00
Dockerfile add docker 2024-01-07 14:19:21 +08:00
LICENSE Initial commit 2023-12-19 09:32:47 +08:00
README.md add demo video 2024-01-10 15:14:22 +08:00
app.py 完善数字人播报 2023-12-28 13:20:11 +08:00
asrreal.py fix audiostream buffer 2024-01-09 10:01:50 +08:00
echo.html 完善数字人播报 2023-12-28 13:20:11 +08:00
encoding.py git init 2023-12-20 17:30:25 +08:00
main.py git init 2023-12-20 17:30:25 +08:00
mpegts-1.7.3.min.js 完善数字人播报 2023-12-28 13:20:11 +08:00
nerfreal.py add demo video 2024-01-10 15:06:08 +08:00
requirements.txt add docker 2024-01-07 14:19:21 +08:00

README.md

A streaming digital human based on the Ernerf model realize audio video synchronous dialogue. It can basically achieve commercial effects.
基于ernerf模型的流式数字人实现音视频同步对话。基本可以达到商用效果

![Watch the video]

Installation

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

Install dependency

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

安装rtmpstream库
参照 https://github.com/lipku/python_rtmpstream

Run

运行rtmpserver (srs)

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中websocket和视频播放地址将serverip替换成实际服务器ip
然后将echo.html和mpegts-1.7.3.min.js拷到/var/www/html下

启动数字人

python app.py

用浏览器打开http://serverip/echo.html在文本框输入任意文字提交。数字人播报该段文字

docker运行

先运行srs和nginx
启动数字人

docker run --gpus all -it --network=host --rm  registry.cn-hangzhou.aliyuncs.com/lipku/nerfstream:v1.2

Data flow

数字人模型文件

可以替换成自己训练的模型(https://github.com/Fictionarry/ER-NeRF)

.
├── data
   ├── data_kf.json			
   ├── pretrained
   └── └── ngp_kg.pth

TODO

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

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