How gizemexe/emotions works
Moodify captures webcam frames, detects facial emotion, and uses the latest detected category to fetch Spotify playlist tracks for display in the web interface. A separate training workflow builds the CNN weights used at runtime. The excerpts show the Flask-to-camera and Flask-to-Spotify calls; the README documents the interface behavior. The template itself was not sampled, so its detailed request wiring is not shown.
Main entry points: app.py Flask routes · Spotipy.py Recommendation lookup · index.html Web interface · camera.py Face detection
Components 17
Web application
- Web interface
templates/index.html - Flask routes
app.py - Video feed
app.py
Emotion recognition
- Frame capture
camera.py - Face detection
camera.py - Emotion prediction
camera.py - Face cascade
haarcascade_frontalface_default.xml - CNN weights
model.h5
Music recommendations
- Spotify API
- Recommendation lookup
Spotipy.py - Playlist tracks
Spotipy.py - Track details
Spotipy.py
Model training
- CNN training
train.py - Training and validation data
data - Saved weights
model.h5
Other components
- User
- Webcam
Connections 19
- User → Web interface: uses
README.md - Web interface → Flask routes: requests
README.md - Flask routes → Video feed: serves
app.py - Video feed → Frame capture: gets frames
app.py - Webcam → Frame capture: supplies frames
camera.py - Frame capture → Face detection: processes frames
camera.py - Face detection → Face cascade: loads
camera.py - Face detection → Emotion prediction: crops faces
camera.py - Emotion prediction → CNN weights: loads
camera.py - Web interface → Flask routes: requests songs
README.md - Flask routes → Emotion prediction: reads latest category
app.py - Flask routes → Recommendation lookup: requests tracks
app.py - Recommendation lookup → Spotify API: searches playlists
Spotipy.py - Recommendation lookup → Playlist tracks: collects tracks
Spotipy.py - Playlist tracks → Spotify API: fetches playlist items
Spotipy.py - Recommendation lookup → Track details: gets track details
Spotipy.py - Track details → Spotify API: fetches metadata
Spotipy.py - CNN training → Training and validation data: reads
train.py - CNN training → Saved weights: saves weights
train.py