Skip to content

rareMatter/cop4331

 
 

Repository files navigation

cop4331

Processes of Object-Oriented Development

Artifact Links

Burndown
Backlog
Sprint 2 Backlog
UI Video Demo
Sprint 3 Backlog
Presentation Outline
Presentation Slideshow
Sprint 2 UI Video
Design Documents
Vision Statement
Demo Video

Installation/Requirements

This project requires Python 3+ and makes use of several frameworks, e.g. Flask, Angular, Keras, etc. It assumes you are using a Unix-based system. You'll also probably need to have ffmpeg installed and accessible on your system. To setup your environment, please make a new virtualenv using python -m venv venv and then activate it by using source venv/bin/activate. Then, run pip install -r requirements.txt. Note that you may need to have numpy installed first, as one of the packages' dependencies requires it; you can do that by running pip install numpy first.

Run the App

To run the web app, please open two shells and run the following commands.

First shell:

  1. cd static
  2. ng serve

Second shell:

  1. export FLASK_APP=server.py
  2. flask run

Major Components

  • A-Frame - visualisation engine
  • Angular - app frontend
  • Flask - app backend
  • Keras - framework for defining our neural networks
  • Pandas - data wrangling
  • LibROSA - used to generate spectrograms for use in the detection network
  • Tensorflow - underlying engine for Keras
  • YouTube-dl - used to process YouTube links for download

Other Stuff

We used the Free Music Archive to train the genre detection neural network; the fma_small dataset was chosen as it contains a total of 8000 30-second tracks balanced across eight (8) genres, including newly popular ones such as electronic(a).

Preparing the Backend

In order to use the model to predict genres, it must first be trained. Before it can be trained, the dataset must be compiled into a pickle for easy passage to the network. Download your preferred flavor of the FMA dataset and extract it to the desired location. After extraction, change the AUDIO_DIR variable in pickler.py to the root of extracted dataset. Inspect all of the folders for any files that are 1-2 KB large; this is a sign of broken or corrupted files and will cause the script to stop before it dumps the dataset to a pickle. Adjust all the necessary bits and pieces regarding GENRES, genre_to_index, and tracks_dict. Finally, run python pickler.py to create a pickle that will be found at data.pkl.

After the pickle has been prepared, run python trainer.py. The network will automatically split the pickle into training and validation sets, and will train for a user-defined amount of epochs. Upon completion, the model and its weights will be saved to models.yaml and weights.h5 respectively.

About

Processes of Object-Oriented Development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 62.1%
  • CSS 32.0%
  • TypeScript 2.9%
  • HTML 1.6%
  • Python 1.4%