How megatran/emotionrecognitiononhologram works
This is a webcam facial-expression recognition system whose predicted emotion is sent to a Unity character for animated display in a DIY pyramid hologram. The visible Python workflow captures video, detects and resizes faces, classifies them with a CNN, and posts emotion data; separate scripts prepare datasets and train or evaluate models. Unity-side paths show the HTTP server, emotion-processing, serialization, and shape-management components, but their interactions are not excerpted. Dashed links mark documented or plausible integration points whose Unity-side wiring could not be verified.
Main entry points: predictModel.py Live prediction · SimpleHttpServer.cs HTTP server · EmotionProcessor.cs Emotion processor · imageDataExtract.py Face data
Components 18
Vision and prediction
- Live prediction
cv-deeplearning/predictModel.py - Face data
cv-deeplearning/imageDataExtract.py
Model development
- CNN training
cv-deeplearning/model.py - Model evaluation
cv-deeplearning/load-model.py
Unity expression
- HTTP server
EmotionalExpressionUnity/Assets/WebServer/SimpleHttpServer.cs - HTTP response
EmotionalExpressionUnity/Assets/WebServer/SimpleResponse.cs - Emotion processor
EmotionalExpressionUnity/Assets/EmotionProcessor.cs - Emotion JSON
EmotionalExpressionUnity/Assets/EmotionJson.cs - Emotion state
EmotionalExpressionUnity/Assets/EmotionData.cs - Shape management
EmotionalExpressionUnity/Assets/ShapeManagement.cs - Unity character
EmotionalExpressionUnity/Assets/ShapeKeys.prefab - Hologram display
EmotionalExpressionUnity/Assets/facialExpressionDemo.unity
Dataset preparation
- Sample capture
cv-deeplearning/photoCapture.py - Image cropping
cv-deeplearning/dataTools/image_cropper.py - Image resizing
cv-deeplearning/dataTools/image_resize.py - Gray conversion
cv-deeplearning/dataTools/convertToGray.py
Other components
- Operator
- Webcam
Connections 14
- Operator → Live prediction: starts capture
README.md - Webcam → Live prediction: provides frames
cv-deeplearning/predictModel.py - Live prediction → Face data: imports data module
cv-deeplearning/predictModel.py - Operator → Sample capture: directs sampling
cv-deeplearning/photoCapture.py - CNN training → Face data: loads datasets
cv-deeplearning/model.py - Model evaluation → Face data: loads matrices
cv-deeplearning/load-model.py - Live prediction → HTTP server: posts emotion
- HTTP server → HTTP response: uses response
- HTTP server → Emotion processor: dispatches emotion
- Emotion processor → Emotion JSON: decodes data
- Emotion processor → Emotion state: updates state
- Emotion state → Shape management: drives expression
- Shape management → Unity character: animates
- Unity character → Hologram display: displays in scene