This project aims to predict the genre of a given song file using Data Science and Machine Learning techniques.
This repository contains the REST API built using Fast API that serves the Tensorflow model and librosa to extract features from uploaded MP3 files.
- Web application: https://classify.k8s.pouretadev.com/
- Frontend - Web App: https://github.com/andbluedev/Music-Genre-Classification-Model-Web-APP
- Project Notebooks: https://github.com/andbluedev/Music-Genre-Classification-Notebooks
It is recommended to use a virtual python environment in order to install every dependency.
Create a virtual environment the venv directory at the root of this project.
python3 -m venv venv
To activate the created virtual environment
source venv/bin/activate
Installing dependencies:
pip install -r requirements.txt
uvicorn app.main:app --reload --port 5000
note: any other availabel port can be used
The Fast API for production uses Docker, python and uvicorn and is deployed on a kubernetes cluster.
docker build -t music-genre-prediction-model-rest-api .
docker run -p 5000:5000 music-genre-prediction-model-rest-api
note: Add -d to this command if you wan't to run the app in detached mode (running in the background leaving the current shell available for other commands).
The API documentation can be found here while the app is running locally (assuming it is running on localhost:5000).
