Spaces:
Sleeping
Sleeping
metadata
title: Aura Emotion Detection API
emoji: π€
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
π€ Aura Emotion Detection API
Real-time emotion detection from audio using Wav2Vec2 model from Hugging Face.
π Features
- Real-time Emotion Detection: Uses
superb/wav2vec2-base-superb-ermodel - Multiple Audio Formats: Supports WAV, MP3, WebM, and more
- Fast Processing: Optimized for real-time analysis
- REST API: Easy integration with any frontend
π API Endpoints
Health Check
GET /health
Predict Emotion
POST /predict
Content-Type: multipart/form-data
Body: audio file (WAV, MP3, WebM, etc.)
Response:
{
"emotion": "happy",
"confidence": 0.85,
"model": "Wav2Vec2 (Hugging Face)"
}
π― Supported Emotions
happy- Joyful, cheerfulsad- Sad, melancholicangry- Angry, frustratedcalm- Calm, relaxedexcited- Excited, energeticneutral- Neutral, no strong emotion
π οΈ Technology Stack
- Framework: FastAPI
- Model: Wav2Vec2 (superb/wav2vec2-base-superb-er)
- Audio Processing: librosa, soundfile, pydub
- ML Framework: PyTorch, Hugging Face Transformers
π Usage Example
import requests
# Upload audio file
with open('audio.wav', 'rb') as f:
files = {'audio': f}
response = requests.post(
'https://your-username-aura-emotion-api.hf.space/predict',
files=files
)
result = response.json()
print(f"Detected emotion: {result['emotion']}")
π Frontend Integration
The frontend is deployed on Vercel and connects to this API for real-time emotion detection from microphone input.
π License
MIT License