Git Product home page Git Product logo

csrivastava003 / emotion-music-player Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chubbyman2/emotion-music-player

0.0 0.0 0.0 78.18 MB

A music player that recommends songs based on your detected mood. Created for TOHacks 2021.

Home Page: https://emotion-music-player.herokuapp.com/

License: MIT License

JavaScript 10.32% Python 9.14% CSS 3.70% HTML 3.16% Jupyter Notebook 73.68%

emotion-music-player's Introduction

Emotion-Based Music Player

A web-based music player which detects the user's mood and recommends a set of songs, while changing its background theme accordingly. Created for TOHacks 2021, May 8-9. Made using HTML/CSS/Javascript for the frontend and Django/Python for the backend. The backend integrates both the Haar Cascade machine learning model and a CNN classifier through OpenCV. The classifier was trained using Colaboratory and Tensorflow. Essentially, the Haar Cascade algorithm utilizes the user's webcam to locate the user's face, which is then passed onto the classifier to detect what emotion the person is displaying. The classifier is trained on 4 emotions: Angry, Happy, Calm, and Sad. Depending on what emotion it detects, it will change the song selection and background of the music player accordingly.

Getting Started

To deploy on a local host:

cd main
python manage.py runserver

Prerequisites

See requirements.txt. Note that most of it isn't needed to run locally, but for hosting on Heroku.

tensorflow-cpu
opencv-python-headless
imutils==0.5.3
imageio
dj-database-url==0.5.0
Django==3.1.2
gunicorn==20.0.4
psycopg2-binary==2.8.6
whitenoise==5.2.0

Demonstration

Web app is already deployed on Heroku: https://emotion-music-player.herokuapp.com/

Built With

  • HTML/CSS - Frontend styling and web page design
  • Javascript - Frontend music player functions
  • Django - Backend integration of machine learning algorithms
  • OpenCV - Computer vision tasks
  • Colab/Tensorflow - Training the emotion classifier

Dataset

The dataset was initially retrieved from Kaggle from a research prediction competiton titled "Challenges in Representation Learning: Facial Expression Recognition Challenge." A direct link to the dataset is also provided. The data consists of 48x48 pixel grayscale images of faces. The faces have been automatically registered so that the face is more or less centered and occupies about the same amount of space in each image. Even though there are 7 labelled classes of expressions, we only decided to utilize the 4 most common ones.

Training Results

Final Accuracy = 58.33%, Validation Accuracy = 54.99%

Authors

Big thanks to the organizers at TOHacks and everyone on Team AlphaHax.

  • Charles Yuan
  • Dulhan Naidappuwa Waduge
  • Golden Wang
  • Ilan Benjamin

License

This project is licensed under the MIT License - see the LICENSE file for details.

emotion-music-player's People

Contributors

chubbyman2 avatar d-projects avatar golden-wang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.