How amalvichu/fere-facial_emotion_recognition_engine works
This is a browser-based, real-time facial emotion recognizer. The principal workflow captures webcam frames, posts them to the FastAPI prediction endpoint, detects faces, classifies each crop using a trained CNN or mock fallback, and displays results. The frontend also smooths predictions, tracks history, and supports CSV export; status polling and model-mode reporting are part of the experience. Arrows reflect shown calls or documented transfers; unsampled details are not inferred.
Main entry points: App.jsx Application Controller · main.py FastAPI Endpoints · Webcam.jsx Camera Capture · model_loader.py Emotion Model Manager
Components 15
Capture and Interface
- Camera Capture
frontend/src/components/Webcam.jsx
Frontend Results
- Application Controller
frontend/src/App.jsx - Status Header
frontend/src/components/Header.jsx - Emotion Card
frontend/src/components/EmotionResult.jsx - Probability Bars
frontend/src/components/ProbabilityBars.jsx - Prediction Smoothing
frontend/src/App.jsx - Prediction History and CSV
frontend/src/App.jsx
Prediction Service
- FastAPI Endpoints
backend/main.py
Face and Emotion Inference
- Image Decoder
backend/utils.py - Haar Face Detection
backend/utils.py - Emotion Model Manager
backend/model_loader.py - Emotion CNN
backend/model_loader.py - Model Checkpoints
models
Other components
- Browser User
- Webcam
Connections 17
- Browser User → Camera Capture: starts camera
frontend/src/components/Webcam.jsx - Webcam → Camera Capture: streams video
README.md - Camera Capture → Application Controller: submits frames
frontend/src/components/Webcam.jsx - Application Controller → FastAPI Endpoints: posts frames
frontend/src/App.jsx - FastAPI Endpoints → Application Controller: returns predictions
frontend/src/App.jsx - Application Controller → FastAPI Endpoints: checks status
frontend/src/App.jsx - FastAPI Endpoints → Image Decoder: decodes image
backend/main.py - FastAPI Endpoints → Haar Face Detection: detects faces
backend/main.py - FastAPI Endpoints → Emotion Model Manager: predicts crops
backend/main.py - Emotion Model Manager → Emotion CNN: runs inference
backend/model_loader.py - Emotion Model Manager → Model Checkpoints: loads checkpoint
README.md - Application Controller → Prediction Smoothing: smooths probabilities
frontend/src/App.jsx - Application Controller → Prediction History and CSV: records predictions
frontend/src/App.jsx - Application Controller → Camera Capture: passes face boxes
frontend/src/App.jsx - Application Controller → Status Header: renders status
frontend/src/App.jsx - Application Controller → Emotion Card: renders emotion
frontend/src/App.jsx - Application Controller → Probability Bars: renders probabilities
frontend/src/App.jsx