Downloads · 30 days
26
1% of all-time downloads
danilotpnta/HuBERT-Genre-Clf
HuBERT-Genre-Clf is a audio classification model from danilotpnta. Use it for the audio classification task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
26
1% of all-time downloads
All-time downloads
4.2K
Public
Parameters
23.7M
286 MB on disk
Likes
1
Public
Click a slice to open those files.
.pt190 MB · 67%
From the Hugging Face model README
<img src="assets/img.jpg"></img>
This model is a fine-tuned version of DistilHuBERT for audio genre classification tasks. DistilHuBERT is a distilled variant of the HuBERT model, optimized for efficient and effective audio processing. This classifier is capable of categorizing audio files into various musical genres, leveraging the powerful representations learned by DistilHuBERT.
Usage:
To use this model, you can load it with the transformers library as follows:
from transformers import AutoModelForAudioClassification, AutoFeatureExtractor
model_name = "danilotpnta/HuBERT-Genre-Clf"
model = AutoModelForAudioClassification.from_pretrained(model_name)
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
# Example usage for an audio file
import torch
import librosa
audio_file = "path_to_your_audio_file.wav"
audio, sr = librosa.load(audio_file, sr=feature_extractor.sampling_rate)
inputs = feature_extractor(audio, sampling_rate=sr, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_class = logits.argmax(dim=-1).item()
print(f"Predicted genre: {model.config.id2label[predicted_class]}")
Performance:
The model achieves an impressive 80.63% accuracy on the GTZAN test dataset for genre classification tasks, demonstrating its efficacy and reliability. This high level of performance makes it a valuable asset for various applications, including music recommendation systems and audio analysis tools.
Weights for this model are available in Safetensors,PyTorch format.
Download them in the Files & versions tab.
License: MIT