Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available: 6.16.0
metadata
title: Music Genre Classifier
emoji: π΅
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 6.11.0
app_file: app.py
pinned: false
python_version: '3.10'
π΅ Music Genre Classifier
This project uses a fine-tuned DistilHuBERT model to classify music genres from the GTZAN dataset. It features a real-time web interface built with Gradio.
π Features
- Model: Fine-tuned
ntu-spml/distilhuberton 10 genres (Blues, Classical, Country, Disco, Hiphop, Jazz, Metal, Pop, Reggae, Rock). - Interface: Upload or record audio directly via the browser.
- Top-K Predictions: Displays the top 5 most likely genres with confidence scores.
π οΈ Setup and Installation
Clone the repository:
git clone <your-repo-link> cd MusicGenreClassifierCreate the environment:
conda create -n audio python=3.10 -y conda activate audio conda install -c conda-forge pyarrow datasets -y pip install transformers accelerate torch torchaudio librosa gradio evaluate
π» Usage
Training/Fine-tuning
To train the model on your local machine:
python main.py
Running the App
To launch the Gradio web interface:
python app.py
π Dataset
The model is trained on the GTZAN dataset, which consists of 1,000 audio tracks each 30 seconds long. It is the most used public dataset for evaluation in machine listening.
π Model Link
The fine-tuned weights are available here: aditya20t/distilhubert-musicClassifier