Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,11 +1,56 @@
|
|
| 1 |
---
|
| 2 |
-
title: SER
|
| 3 |
-
emoji: π
|
| 4 |
-
colorFrom: gray
|
| 5 |
-
colorTo: red
|
| 6 |
sdk: docker
|
| 7 |
-
|
| 8 |
-
license: mit
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: SER Wav2Vec
|
|
|
|
|
|
|
|
|
|
| 3 |
sdk: docker
|
| 4 |
+
app_port: 7860
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
+
# π€ Speech Emotion Recognition β Wav2Vec2 (FastAPI + Docker)
|
| 8 |
+
|
| 9 |
+
This Hugging Face Space provides a backend API for **Speech Emotion Recognition (SER)**
|
| 10 |
+
using the Wav2Vec2ForSequenceClassification model.
|
| 11 |
+
|
| 12 |
+
The backend is implemented using **FastAPI** and runs inside a **Docker** container
|
| 13 |
+
that exposes the `/predict` endpoint to accept audio and return emotion scores.
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## π API Endpoints
|
| 18 |
+
|
| 19 |
+
### **1. Health Check**
|
| 20 |
+
|
| 21 |
+
##/GET
|
| 22 |
+
|
| 23 |
+
Example Response:
|
| 24 |
+
```json
|
| 25 |
+
{ "status": "ok" }
|
| 26 |
+
|
| 27 |
+
Emotion Prediction
|
| 28 |
+
POST /predict
|
| 29 |
+
| field | type | description |
|
| 30 |
+
| ----- | ------ | ------------------------------- |
|
| 31 |
+
| file | binary | audio file (.wav / .mp3 / .m4a) |
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
curl -X POST "https://marshal-yash-SER_wav2vec.hf.space/predict" \
|
| 35 |
+
-H "accept: application/json" \
|
| 36 |
+
-H "Content-Type: multipart/form-data" \
|
| 37 |
+
-F "[email protected]"
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
{
|
| 41 |
+
"results": [
|
| 42 |
+
{ "label": "happy", "score": 0.71 },
|
| 43 |
+
{ "label": "neutral", "score": 0.15 },
|
| 44 |
+
{ "label": "sad", "score": 0.08 }
|
| 45 |
+
],
|
| 46 |
+
"dominant": { "label": "happy", "score": 0.71 }
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
βββ server.py # FastAPI application
|
| 51 |
+
βββ Dockerfile # Docker config for HF Spaces
|
| 52 |
+
βββ requirements.txt # Python dependencies
|
| 53 |
+
βββ README.md # Documentation (this file)
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
marshal-yash/SER_wav2vec
|