馃幍 Music Genre Classifier

A EFFICIENTNET model trained on the GTZAN dataset that classifies music audio into 10 genres:

Blues 路 Classical 路 Country 路 Disco 路 Hip-Hop 路 Jazz 路 Metal 路 Pop 路 Reggae 路 Rock

Usage

import torch
import librosa, numpy as np
from torchvision import transforms
from PIL import Image

# Load model
model = ...  # see app/app.py for architecture
ckpt  = torch.hub.load_state_dict_from_url(
    "https://huggingface.co/mpuneeth17/music-genre-classifier/resolve/main/best_model.pth",
    map_location="cpu"
)
model.load_state_dict(ckpt["model"])
model.eval()

Demo

馃憠 Try it live: Hugging Face Space

Training

  • Architecture: efficientnet
  • Dataset: GTZAN (10 genres 脳 100 songs 脳 10 segments = 10,000 samples)
  • Input: 128脳128 Mel Spectrogram images
  • Optimizer: AdamW + CosineAnnealingLR
  • Accuracy: ~88-92%
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 馃檵 Ask for provider support