Skip to content

maheshmm7/EmotiTune-AI

Repository files navigation

🎡 Emotion-Based Media Player Using AI 🎭

About

Emotion-Based Media Player is an AI-powered application that detects facial emotions in real time and plays music based on the user's mood. Using deep learning for emotion recognition and computer vision for face detection, the system categorizes emotions into Happy, Neutral, and Sad and selects songs accordingly.

Key Features

βœ”οΈ Real-time facial emotion detection using OpenCV and Keras
βœ”οΈ AI-driven music selection based on mood
βœ”οΈ Dynamic playlist handling for different emotions
βœ”οΈ Simple and interactive interface

Installation

Prerequisites

Ensure you have the following installed:

  • Python 3.7+ but Python < 3.10
  • TensorFlow & Keras
  • OpenCV
  • NumPy
  • pygame

Setup

  1. Clone the repository:
    git clone https://github.com/your-username/emotion-based-media-player.git  
    cd emotion-based-media-player  
  2. Install required dependencies:
    pip install -r requirements.txt  
  3. Ensure the required files are in place:
    • haarcascade_frontalface_default.xml (Face detection model)
    • Emotion_Detection.h5 (Trained emotion classification model)
    • playlist_happy, playlist_neutral, and playlist_sad directories containing songs

Usage

Run the following command to start the media player:

python test.py  

The application will:

  1. Open a webcam feed and detect faces.
  2. Analyze facial expressions and classify emotions.
  3. Play music from the corresponding playlist based on detected emotion.

Controls

  • Press 'q' to exit the program.
  • Press 'p' to pause music.
  • Press 'r' to resume music.

Directory Structure

πŸ“‚ emotion-based-media-player  
β”œβ”€β”€ πŸ“œ test.py  
β”œβ”€β”€ πŸ“œ requirements.txt  
β”œβ”€β”€ πŸ“‚ playlist_happy  
β”œβ”€β”€ πŸ“‚ playlist_neutral  
β”œβ”€β”€ πŸ“‚ playlist_sad  
β”œβ”€β”€ πŸ“œ haarcascade_frontalface_default.xml  
β”œβ”€β”€ πŸ“œ Emotion_Detection.h5  

Contributing

Feel free to submit issues or contribute by creating a pull request.

License

This project is licensed under the MIT License.

Contact

For any inquiries or feedback, reach out via GitHub Issues.

About

EmotiTune-AI Media Player is an AI-powered application that detects facial emotions in real time and plays music based on the user's mood. Enhance your listening experience with emotion-driven melodies! 🎢

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages