3N4N / music-genre-classifier

Music genre classifier built for a course on machine learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MUSIC GENRE CLASSIFIER
======================

This is a deep-learning project, prepared for BUETUGCSE472 course.


PREPARATION
-----------

1. Clone this repo and cd into it.
2. Download the GTZAN dataset from kaggle.
3. Move the dataset to the proper location.

    mkdir -p ./data
    unzip ~/Downloads/GTZAN_data.zip -d data/

4. Rename the dataset.

    mv data/GTZAN_data data/gtzan

5. Create and activate a virtualenv.

    virtualenv create mlproj
    source ./mlproj/bin/activate    # Linux
    "./mlproj/Scripts/activate"     # Windows

6. Install required packages with the following commands

    pip install -r requirements.txt

7. Extract the features.

    python src/extract_features.py -m -s
    python src/prep_train_test.py   # Skip if train-test sets are already split
    python src/build_model.py

8. Deactivate the virtualenv (or simply close the terminal)


Genre Prediction of Manually Curated Songs
------------------------------------------

To predict the genre of songs outside the GTZAN dataset, you need to extract the
mel-spectrogram features. See the file `src/prep_test_set.py` for inspiration.
Also see `music-genre-classification.ipynb` to see how the trained model can be
used to predict genres.

About

Music genre classifier built for a course on machine learning


Languages

Language:PureBasic 48.2%Language:Jupyter Notebook 47.9%Language:Python 3.9%