TuneGen is an innovative web application that recommends Spotify playlists based on the user's detected emotions using real-time facial recognition and emotion analysis.
TuneGen.Web.App.mp4
- Real-Time Emotion Detection: Uses your webcam to capture facial expressions and detect emotions.
- Emotion-Based Playlist Recommendations: Recommends Spotify playlists that match the detected emotions.
- Interface: Simple and user-friendly web interface.
- Capture Facial Expressions: The webcam captures real-time video of the user's face.
- Emotion Detection: The captured frames are processed to detect faces and predict the user's emotion using a pre-trained deep learning model.
- Playlist Recommendation: Based on the detected emotion, the system recommends a Spotify playlist that matches the user's current emotional state.
- Face Detection: Haar Cascade Classifier for face detection.
- Emotion Detection: A Convolutional Neural Network (CNN) model trained on facial expression data.
- Web Framework: Flask for the web application.
- Video Processing: OpenCV for capturing and processing video frames.
- Deep Learning: Keras with TensorFlow backend for loading and predicting emotions using the pre-trained model.
Ensure the paths for the model and Haarcascade XML file in app.py are correct based on your project structure:
- face_classifier = cv2.CascadeClassifier('path/to/haarcascade_frontalface_default.xml')
- classifier = load_model('path/to/model.h5')
Replace the placeholder Spotify playlist URLs in the playlistmanager function in app.py with your own Spotify premium playlist URLs.
- Run the Flask Application: python app.py
- Access the Application: Open your web browser and go to http://127.0.0.1:5000/.
Flask, OpenCV, Keras, TensorFlow, Numpy
- Face Detection Model: Uses OpenCV's Haar Cascade Classifier to detect faces in the video frames.
- Emotion Detection Model: A deep learning model built with Keras, pre-trained on a dataset of facial expressions to recognize emotions such as Angry, Fear, Happy, Neutral, Sad, and Surprise.
Feel free to fork this repository and contribute by submitting a pull request. For major changes, please open an issue first to discuss what you would like to change.