yourTunes is a JavaScript-based web application developed for the ICS2000 unit project. It uses Flask to host a music player that identifies a user's emotions through their webcam feed and plays music that matches their current mood.
yourTunes utilizes the Viola-Jones method for face detection via the OpenCV.js library, using a Haar-cascade for front facial detection. The detected face is cropped, converted to grayscale, and resized to 224x224 pixels. This image is then analyzed by a TensorFlow model, trained using Teachable Machine, which classifies the face into one of seven emotions: Happy, Sad, Angry, Disgust, Fear, Surprise, and Neutral. The emotion with the highest confidence score is selected, and the application plays a corresponding song based on this emotion.
To get started with yourTunes:
- Ensure you have Python and Flask installed on your system.
- Run the
flask-app.py
script to host the application:python flask-app.py
- Access the application by navigating to
http://localhost:5000/
in your web browser. - Enjoy your personalized music experience!
The application uses Spotify’s API to play tracks, which requires a Premium subscription for full-length playback. Users with a free Spotify account will only have access to previews or snippets of the songs. Upgrade to Spotify Premium to enjoy unlimited access to full tracks.
- Python 3.x
- Python libraries:
Flask
,render_template
,send_from_directory
,request
,abort
,jsonify
,os
,json
Clone the repository:
git clone https://github.com/AFLucas-UOM/yourTunes.git
Contributions to enhance the application or add new features are welcome! Please fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
This project was developed as part of an academic assignment. Unit: CPS2000 at the University of Malta.
For any inquiries or feedback, please contact Andrea Filiberto Lucas.