How khine282/emotionvision works
EmotionVision serves a browser dashboard and FastAPI API for camera management, live emotion detection, MJPEG streaming, and screenshot capture. The principal workflow registers or selects a camera, starts its processor, captures and analyzes frames, caches annotated frames for streaming, and persists detection or screenshot records in Supabase. The README documents the broader dashboard and REST capabilities; source excerpts show concrete route, processor, cache, and storage wiring, while omitted route bodies limit certainty about some operations.
Main entry points: detector_service.py Detector routes · camera_processor.py Camera processor · __init__.py Detector orchestrator · database.py Camera registry
Components 16
API and dashboard
- Web dashboard
static/index.html - FastAPI application
main.py - Detector routes
services/detector_service.py - MJPEG stream
services/detector_service.py
Camera runtime
- Detector orchestrator
detector/__init__.py - Camera processor
detector/camera_processor.py - Model loader
detector/models.py - Frame cache
detector/frame_cache.py - Runtime configuration
detector/config.py
Cloud persistence
- Camera registry
detector/database.py - Detection records
detector/database.py - Screenshot records
detector/database.py
Other components
- Dashboard user
- Webcam / RTSP
- Face and emotion models
- Screenshot storage
Connections 23
- Dashboard user → Web dashboard: opens
- Web dashboard → FastAPI application: requests
- FastAPI application → Detector routes: routes to
- Detector routes → Detector orchestrator: starts or stops
- Detector routes → Camera registry: manages cameras
- Detector orchestrator → Camera registry: loads cameras
- Detector orchestrator → Model loader: loads models
- Detector orchestrator → Camera processor: starts processor
- Camera processor → Webcam / RTSP: captures frames
- Model loader → Face and emotion models: loads
- Camera processor → Face and emotion models: analyzes frames
- Camera processor → Frame cache: writes annotated frames
- Detector routes → Frame cache: reads latest frame
- Detector routes → MJPEG stream: returns stream
- MJPEG stream → Dashboard user: streams frames
- Camera processor → Detection records: writes detections
- Detector routes → Screenshot records: queries or deletes
- Camera processor → Screenshot storage: uploads screenshot
- Detector routes → Screenshot storage: deletes screenshot file
- Detector routes → Screenshot records: writes manual screenshot metadata
- Camera processor → Screenshot records: writes automatic screenshot metadata
- Runtime configuration → Camera registry: configures client
- Runtime configuration → Camera processor: provides capture settings