Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,35 +1,47 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
``
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: "Detect4Enhance Backend"
|
| 3 |
+
emoji: "🤖"
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
sdk_version: "latest"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
# Engagement Detection API
|
| 14 |
+
|
| 15 |
+
A Flask-based API for detecting engagement levels from facial expressions using TensorFlow Lite.
|
| 16 |
+
|
| 17 |
+
## API Endpoints
|
| 18 |
+
|
| 19 |
+
- `GET /`: Returns API information
|
| 20 |
+
- `POST /predict`: Accepts an image file and returns engagement predictions
|
| 21 |
+
|
| 22 |
+
## Deployment
|
| 23 |
+
|
| 24 |
+
1. Clone this repository
|
| 25 |
+
2. Build Docker image: `docker build -t engagement-api .`
|
| 26 |
+
3. Run container: `docker run -p 7860:7860 engagement-api`
|
| 27 |
+
|
| 28 |
+
## Example Usage
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
import requests
|
| 32 |
+
|
| 33 |
+
url = "https://your-huggingface-space-url.hf.space/predict"
|
| 34 |
+
files = {'image': open('test.jpg', 'rb')}
|
| 35 |
+
response = requests.post(url, files=files)
|
| 36 |
+
print(response.json())
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Model Details
|
| 40 |
+
|
| 41 |
+
- Model: Custom TensorFlow Lite model (`engagement_model_89.tflite`)
|
| 42 |
+
- Input: 224x224 RGB face image
|
| 43 |
+
- Output: Probabilities for 4 engagement states:
|
| 44 |
+
- Engaged
|
| 45 |
+
- Frustrated
|
| 46 |
+
- Bored
|
| 47 |
+
- Confused
|