Skip to content

fillipp97/Picture-Mood-Playlist-CPAC

Repository files navigation

Picture-Mood-Playlist

Have you ever thought that for some moments in your life you needed the right soundtrack? This is the app for you! You can provide us with a picture that represents your mood and we will create a Spotify playlist inspired by your image that conveys the same mood as the image.

Introduction

This is the project for the CPAC course, we are Filippo, Jiayan and Haokun (Group7). We created a program that allows users to upload a local photo, or take a photo, then analyze it to return the user's favorite songs in their Spotify account.

Contributors


Logo

Picture-Mood-Playlist

You take a picture, we provide you a coherent playlist
Code »

Table of Contents
  1. About The Project
  2. Getting Started
  3. Description
  4. Implementation
  5. Contacts

About The Project

Picture Mood Playlist is an entertainment application that allows you to generate a Spotify playlist based on the mood of an input picture.

Main screen

(back to top)

Built With

  • React
  • Flask

(back to top)


Getting Started

Follow the steps below to download, setup and run the app locally.

Prerequisites

Before running, you will need the following:

  • Node.js

     https://nodejs.org/en/download/
  • python 3.x (3.7 or above recommended)

    https://www.python.org/downloads/

Installation

  1. Clone the repo
    git clone https://github.com/armandoboemio/i-am-groove.git
  2. Install NPM packages
    cd client
    npm i
  3. Install python libraries
    cd server
    pip install -r requirements.txt

Startup

  1. Run Flask
    cd server
    flask run
  2. Run NPM
    cd client
    npm start

(back to top)


Description

The user can tweak the parameters to get different rhytmic grooves and patterns.

Step1

Step1

User is asked to upload or take a picture of any kind. After the upload the AI process starts. We can have two situations:

  • Face is present
  • Face is not present
In the first case the picture is analyzed by Azure's APIs for face emotion detection and a mood is provided. In the second case, relying upon Goethe's principles, we linked the color psychology to a mood extracted with low level features, moreover the image is analyzed by an SSD MobileNetv2, a fast network for object detection purposes. All the retrieved information is sent back to the front-end.

Step2

Step2

This step directly follows the previous one. The data we sent before is used in order to presonalize the user experience and to entertain him by asking him questions about his favourite songs and artists. When no face is present in the picture questions related to objects will appear and the chosen objects will be later used for the Playlist Generation purposes.

Step3

Step3

Finally, the answer of the previous questions, after some modifications, are used as a seed to request some recommened songs to the Spotify API. The returned songs will be filtered according to some rules that will give them scores: the closer the song is to the mood, the higher the score will be.

(back to top)


Implementation

The app has been realized using a front-end + back-end approach.

Front-end

The front-end or client is realized using the React framework. The client is composed by a main and different modules. Each sub-window function is defined as a component.

  • The app component handles the conditional rendering of two children: LoggedIn.js and NotLoggedIn.js most of the GUI elements and state parameters updates are handled by these two components.
    • NotLoggedIn.js Handles the Spotify authentication process
    • LoggedIn.js contains all the web app logics and all the interactive steps after the user has logged in

Back-end

The back-end or server is written in python using the micro-framework Flask. Here all the heavy-weight computation is done. In particular, the object recognition and mood recognition tasks are performed in this context. The API setups the routes to receive and send (GET and POST methods) the commands from the front-end. Secondary files hold the necessary functions for the main code to work. For example Spotify an Musixmatch calls are present.

(back to top)


Contacts

Jayan Cui - [email protected]

Filippo Gualtieri - [email protected]

Haokun Song - [email protected]

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •