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