/orchestrate-ai

Deep Learning application to classify music by emotion and to generate music by emotion

Primary LanguagePythonMIT LicenseMIT

Orchestrate AI

Orchestrate AI is a deep learning project which classifies music according to moods and generates music from given mood label.

Application Clients

Orchestrate AI has a web client and an android client. The web client is deployed in heroku and android client resides in this repository.

Python 2.7 because a dependency (python-midi) does not support python 3.

Dependencies

Setup

Run two setup scripts - setup.py and postsetup.py.

Run only postsetup.py in 'sudo' mode to install correct dependencies. If setup.py is runs in 'sudo' mode, then the dependencies are installed in global packages location instead of virutalenv.

Manual Setup

Use virtualenvwrapper or virtualenv for better support.

  • Setup Virtualenv
mkvirtualenv orchestrate_ai --python=$(which python)
  • Install pip dependencies.
pip install -r requirements.txt
  • Install youtube-dl
sudo apt update
sudo apt install youtube-dl

Running Web Client

All the code for web client goes inside orchestrate_ai/webclient module.

To run dev server:

python runwebclient.py

Prepare Dataset

For preparing data set run prepare_dataset.py script. It uses simplejson, urllib3 and YouTube API to download video list from YouTube Audio Library Channel. It then uses youtube-dl to download videos in audio format of m4a from the given list.

python prepare_dataset.py

Training MIREX MIDI Dataset

Run trainer.py to train the given dataset. The dataset to be trained are placed in midis folder. It may take some time.

python trainer.py

Getting Confidence Score for MIREX MIDI Dataset

Run predictor.py with file location as an argument.

python predictor.py ~/music/testingmidi.midi

Training MIREX Lyrics Dataset

Run lyrics_trainer.py to train the given dataset. The dataset to be trained are placed in lyrics folder. It may take some time.

python lyrics_trainer.py

Getting Confidence Score for MIREX Lyrics Dataset

Run lyrics_predictor.py.

Available options:

  • -f: File location of lyrics
  • -s: Lyrics string
  • -h: Help
python lyrics_predictor.py -f ~/lyrics/song_lyrics.txt
python lyrics_predictor.py -s "Some song lyrics goes here."
python lyrics_predictor.py -h