Skip to content

TuneGen is a web application that recommends Spotify playlists by analyzing the user's emotions in real-time through facial recognition and emotion detection.

Notifications You must be signed in to change notification settings

KaShiekzmi/TuneGen-Emotion-based-Spotify-playlist-recommendation-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TuneGen: Emotion-Based Spotify Playlist Recommendation System

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 Video

TuneGen.Web.App.mp4

Features

  • 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.

How It Works

  1. Capture Facial Expressions: The webcam captures real-time video of the user's face.
  2. Emotion Detection: The captured frames are processed to detect faces and predict the user's emotion using a pre-trained deep learning model.
  3. Playlist Recommendation: Based on the detected emotion, the system recommends a Spotify playlist that matches the user's current emotional state.

Models and Technologies Used

  • 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.

Update Model and Haarcascade Paths

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')

Add Your Spotify Playlists

Replace the placeholder Spotify playlist URLs in the playlistmanager function in app.py with your own Spotify premium playlist URLs.

Running the Application

  1. Run the Flask Application: python app.py
  2. Access the Application: Open your web browser and go to http://127.0.0.1:5000/.

Required Libraries

Flask, OpenCV, Keras, TensorFlow, Numpy

Models

  1. Face Detection Model: Uses OpenCV's Haar Cascade Classifier to detect faces in the video frames.
  2. 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.

Contribution

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.

About

TuneGen is a web application that recommends Spotify playlists by analyzing the user's emotions in real-time through facial recognition and emotion detection.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published