keremberke/license-plate-object-detection
Viewer • Updated • 8.83k • 845 • 40
How to use Felguk/Felguk-suno-or-people with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("zero-shot-classification", model="Felguk/Felguk-suno-or-people") # Load model directly
from transformers import AutoProcessor, AutoModelForAudioClassification
processor = AutoProcessor.from_pretrained("Felguk/Felguk-suno-or-people")
model = AutoModelForAudioClassification.from_pretrained("Felguk/Felguk-suno-or-people", device_map="auto")
This model is designed to classify audio clips into two categories: "Suno" music or "People" music. It is trained on a dataset containing examples of both types of music and can be used for various applications such as music recommendation, genre classification, and more.
felguk-suno-or-peoplesuno or people)This model is not currently available via third-party inference providers or the Hugging Face Inference API. However, you can easily use it locally by following the steps below.
Make sure you have the transformers and datasets libraries installed:
pip install transformers datasets
from transformers import AutoModelForAudioClassification, AutoFeatureExtractor
import torch
# Load the model and feature extractor
model = AutoModelForAudioClassification.from_pretrained("Felguk/Felguk-suno-or-people")
feature_extractor = AutoFeatureExtractor.from_pretrained("Felguk/Felguk-suno-or-people")
from datasets import load_dataset, Audio
# Load an example audio file (replace with your own file)
dataset = load_dataset("common_voice", "en", split="train", streaming=True)
audio_sample = next(iter(dataset))["audio"]
# Preprocess the audio
inputs = feature_extractor(audio_sample["array"], sampling_rate=audio_sample["sampling_rate"], return_tensors="pt")
# Perform inference
with torch.no_grad():
logits = model(**inputs).logits
# Get the predicted label
predicted_class_id = logits.argmax().item()
label = model.config.id2label[predicted_class_id]
print(f"Predicted label: {label}")
Base model
microsoft/conditional-detr-resnet-50