Instructions to use vkushwahaa/audio-emotion-recognition with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use vkushwahaa/audio-emotion-recognition with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://vkushwahaa/audio-emotion-recognition") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Audio Emotion Recognition
This model recognizes emotions in speech audio files. It can detect the following emotions:
- Angry
- Disgust
- Fear
- Happy
- Neutral
- Sad
- Surprise
Model Description
This model uses a two-stage approach:
- Audio feature extraction using YAMNet
- Emotion classification using a custom neural network
Usage
Installation
pip install tensorflow librosa huggingface_hub tensorflow_hub
Quick Start
from huggingface_hub import snapshot_download
import os
import sys
sys.path.append(snapshot_download(repo_id="vkushwahaa/audio-emotion-recognition"))
from emotion_recognizer import load_from_hf
# Load model
recognizer = load_from_hf()
# Predict emotion from audio file
result = recognizer.predict("path/to/audio.wav")
# Print results
print(f"Predicted emotion: {result['predicted_emotion']} (confidence: {result['confidence']:.2f})")
Command Line Usage
python emotion_recognizer.py path/to/audio.wav
Training
This model was trained on multiple datasets:
- CREMA-D
- RAVDESS
- SAVEE
- TESS
The model uses YAMNet embeddings as features and employs data augmentation techniques to improve robustness.
- Downloads last month
- 1
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support