Views
No views yet
| Training Step | Training Loss | Validation Loss |
|---|---|---|
| 25 | 2.192 | 2.185 |
| 250 | 1.290 | 1.266 |
| 500 | 0.540 | 0.528 |
| 1000 | 0.159 | 0.289 |
| 1500 | 0.177 | 0.318 |
| 2000 | 0.000 | 0.197 |
| 2500 | 0.000 | 0.185 |
| 2800 | 0.000 | 0.174 |
1from transformers import AutoModelForAudioClassification, AutoFeatureExtractor
2import torch
3import torchaudio
4
5# Load model and feature extractor
6model_name = "aicinema69/audio-emotion-detector-large"
7feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
8model = AutoModelForAudioClassification.from_pretrained(model_name)
9
10# Prepare audio
11audio_path = "path/to/your/audio.wav"
12waveform, sample_rate = torchaudio.load(audio_path)
13waveform = waveform.squeeze().numpy()
14
15# Resample if needed
16if sample_rate != feature_extractor.sampling_rate:
17 # Add resampling code here if needed
18 pass
19
20# Extract features
21inputs = feature_extractor(
22 waveform,
23 sampling_rate=feature_extractor.sampling_rate,
24 return_tensors="pt"
25)
26
27# Predict
28with torch.no_grad():
29 outputs = model(**inputs)
30 predictions = outputs.logits.argmax(-1)
31
32# Map prediction to emotion label
33id2label = model.config.id2label
34predicted_emotion = id2label[predictions.item()]
35print(f"Predicted emotion: {predicted_emotion}")@misc{audio-emotion-detector,
author = {aicinema69},
title = {Audio Emotion Detector Large},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/aicinema69/audio-emotion-detector-large}}
}@article{conneau2020unsupervised,
title={Unsupervised Cross-lingual Representation Learning for Speech Recognition},
author={Conneau, Alexis and Baevski, Alexei and Collobert, Ronan and Mohamed, Abdelrahman and Auli, Michael},
journal={arXiv preprint arXiv:2006.13979},
year={2020}
}@misc{skit-ai-emotion-tts-dataset,
author = {Skit.ai},
title = {Emotion TTS Dataset},
year = {2022},
publisher = {GitHub},
howpublished = {\url{https://github.com/skit-ai/emotion-tts-dataset}}
}