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.
βοΈ 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
Ensure you have the following installed:
- Python 3.7+ but Python < 3.10
- TensorFlow & Keras
- OpenCV
- NumPy
- pygame
- Clone the repository:
git clone https://github.com/your-username/emotion-based-media-player.git cd emotion-based-media-player - Install required dependencies:
pip install -r requirements.txt
- 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, andplaylist_saddirectories containing songs
Run the following command to start the media player:
python test.py The application will:
- Open a webcam feed and detect faces.
- Analyze facial expressions and classify emotions.
- Play music from the corresponding playlist based on detected emotion.
- Press 'q' to exit the program.
- Press 'p' to pause music.
- Press 'r' to resume music.
π emotion-based-media-player
βββ π test.py
βββ π requirements.txt
βββ π playlist_happy
βββ π playlist_neutral
βββ π playlist_sad
βββ π haarcascade_frontalface_default.xml
βββ π Emotion_Detection.h5
Feel free to submit issues or contribute by creating a pull request.
This project is licensed under the MIT License.
For any inquiries or feedback, reach out via GitHub Issues.