Skip to content

jiaofangxu/digital-human

Repository files navigation


prai_dh

PRAI实验室

数字人-服务器版

注意:本项目有两个分支,master为单机演示版本;server-version是服务器开发版本

使用:语音沟通,显示流式传输过程,显示语音转文字纠错过程,交互过程丝滑无卡顿;

一、数字人架构

Remote Android      Local PC     Remote PC

     └─────────────┼─────────────┘

      Aliyun API ─┐   │

            ├── ASR   

         FunASR ─┘    │     ┌─ Yuan 1.0

               │     ├─ LingJu

               NLP ────┼─ GPT/ChatGPT

               │     ├─ Rasa+ChatGLM-6B

         Azure ─┐    │     ├─ VisualGLM

        Edge TTS ─┼── TTS     └─ RWKV

         开源 TTS ─┘   │    

               │    

               │    

    ┌──────────┬────┼───────┬─────────┐

Remote Android  Live2D   UE    xuniren   Remote PC

重要:prai-数字人(服务端)与数字人(网页客户端)的通讯接口: ws://127.0.0.1:10003(已接通)

消息格式: 查看 WebSocket.md

***二、代码结构 ***

.
├── main.py		    # 程序主入口
├── prai_dh_booter.py	    # 核心启动模块
├── config.json		    # 控制器配置文件
├── system.conf		    # 系统配置文件
├── ai_module
│   ├── ali_nls.py	        # 阿里云 实时语音
│   ├── ms_tts_sdk.py       # 微软 文本转语音
│   ├── nlp_lingju.py       # 灵聚 人机交互-自然语言处理
│   ├── xf_aiui.py          # 讯飞 人机交互-自然语言处理
│   ├── nlp_gpt.py          # gpt api对接
│   ├── nlp_chatgpt.py      # chat.openai.com逆向对接
│   ├── nlp_yuan.py         # 浪潮.源大模型对接
│   ├── nlp_rasa.py         # ChatGLM-6B的基础上前置Rasa会话管理(强烈推荐)
│   ├── nlp_VisualGLM.py    # 对接多模态大语言模型VisualGLM-6B
│   ├── nlp_rwkv.py         # 离线对接rwkv
│   ├── nlp_rwkv_api.py     # rwkv server api
│   ├── yolov8.py           # yolov8资态识别
│   └── xf_ltp.py           # 讯飞 情感分析
├── bin                     # 可执行文件目录
├── core                    # 数字人核心
│   ├── prai_dh_core.py         # 数字人核心模块
│   ├── recorder.py         # 录音器
│   ├── tts_voice.py        # 语音生源枚举
│   ├── authorize_tb.py     # prai_dh.db认证表管理
│   ├── content_db.py       # prai_dh.db内容表管理
│   ├── interact.py         # 互动(消息)对象
│   ├── song_player.py      # 音乐播放(暂不可用)
│   └── wsa_server.py       # WebSocket 服务端
├── gui                     # 图形界面
│   ├── flask_server.py     # Flask 服务端
│   ├── static
│   ├── templates
│   └── window.py           # 窗口模块
├── scheduler
│   └── thread_manager.py   # 调度管理器
├── utils                   # 工具模块
    ├── config_util.py      
    ├── storer.py
    └── util.py
└── test                    # 都是惊喜

代码架构图: 代码逻辑架构图

三、安装说明

环境

  • Python 3.9、3.10
  • Windows、macos、linux

安装依赖

pip install -r requirements.txt

配置应用密钥

  • 查看 API 模块
  • 浏览链接,注册并创建应用,将应用密钥填入 ./system.conf

启动

启动数字人服务器

python main.py

API 模块

启动前需填入应用密钥

代码模块 描述 链接
./ai_module/ali_nls.py 实时语音识别(可选) https://ai.aliyun.com/nls/trans
./ai_module/ms_tts_sdk.py 微软 文本转情绪语音(可选) https://azure.microsoft.com/zh-cn/services/cognitive-services/text-to-speech/
./ai_module/xf_ltp.py 讯飞 情感分析(可选) https://www.xfyun.cn/service/emotion-analysis
./utils/ngrok_util.py ngrok.cc 外网穿透(可选) http://ngrok.cc
./ai_module/nlp_lingju.py 灵聚NLP api(支持GPT3.5及多应用)(可选) https://open.lingju.ai 需联系客服务开通gpt3.5权限
./ai_module/yuan_1_0.py 浪潮源大模型(可选) https://air.inspur.com/

About

No description, website, or topics provided.

Resources

License

Stars

4 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors