How hewei-24/srtp works
心晴 is a local-first student mental-health support platform. Its primary workflow is browser chat or speech input, optional camera-based emotion analysis, a psychology response, then synthesized audio and avatar video playback. A separate 心理润园 branch provides educational and self-help resources. The README documents capabilities beyond the sampled source; links for those and optional SadTalker integration are therefore limited to documented relationships.
Main entry points: app.py REST service · main.js Browser UI · api.js API client · speech.js Speech input
Components 21
User experience
- Browser UI
static/js/main.js - API client
static/js/api.js - Speech input
static/js/modules/speech.js - Camera emotion
static/js/modules/camera.js - Avatar playback
static/js/modules/avatar.js
Flask services
- REST service
app.py - Face emotion
app.py - Speech recognition
app.py - Conversation state
app.py
Response generation
- Psychology agent
app.py - Local Qwen model
app.py - Edge TTS
app.py - Generated audio
app.py
Wellbeing resources
- Psychology garden
app.py
Avatar media
- Avatar management
app.py - Custom uploads
app.py - Speaking videos
SadTalker/src/gradio_demo.py - SadTalker synthesis
SadTalker/inference.py
Other components
- Student
- DeepFace runtime
- Edge TTS engine
Connections 24
- Student → Browser UI: uses
- Browser UI → Speech input: captures speech
- Speech input → Browser UI: provides text
- Browser UI → Camera emotion: starts analysis
- Camera emotion → API client: requests emotion
- API client → REST service: calls API
- REST service → Face emotion: dispatches
- Face emotion → DeepFace runtime: analyzes face
- REST service → Speech recognition: dispatches
- REST service → Psychology agent: dispatches
- Psychology agent → Local Qwen model: generates reply
- Psychology agent → Conversation state: manages history
- REST service → Edge TTS: synthesizes reply
- Edge TTS → Edge TTS engine: generates audio
- Edge TTS → Generated audio: writes audio
- REST service → Avatar management: selects avatar
- Avatar management → Custom uploads: stores upload
- REST service → Speaking videos: selects video
- Browser UI → API client: submits message
- Browser UI → Avatar playback: updates playback
- API client → Browser UI: returns response
- Browser UI → Generated audio: plays audio
- Student → Psychology garden: uses resources
- REST service → SadTalker synthesis: optional integration