Edit model card

Music Genre Classification Model ๐ŸŽถ

This model classifies music genres based on audio signals. It was fine-tuned on the music_genres_small dataset using the Wav2Vec2 architecture.

Metrics

  • Validation Accuracy: 75%
  • F1 Score: 74%
  • Validation Loss: 0.77

Example Usage

from transformers import Wav2Vec2ForSequenceClassification, Wav2Vec2FeatureExtractor
import torch

# Load model and feature extractor
model = Wav2Vec2ForSequenceClassification.from_pretrained("gastonduault/music-classifier")
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("facebook/wav2vec2-large")

# Process audio file
audio_path = "path/to/audio.wav"
audio_input = feature_extractor(audio_array, sampling_rate=16000, return_tensors="pt", padding=True)

# Predict
with torch.no_grad():
    logits = model(audio_input["input_values"])
    predicted_class = torch.argmax(logits.logits, dim=-1)
print(predicted_class)
Downloads last month
66
Safetensors
Model size
94.6M params
Tensor type
F32
ยท
Inference API
Unable to determine this model's library. Check the docs .

Model tree for gastonduault/music-classifier

Finetuned
(18)
this model

Dataset used to train gastonduault/music-classifier