Spaces:
Runtime error
Runtime error
File size: 885 Bytes
2accea7 |
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 36 |
# Engagement Detection API
A Flask-based API for detecting engagement levels from facial expressions using TensorFlow Lite.
## API Endpoints
- `GET /`: Returns API information
- `POST /predict`: Accepts an image file and returns engagement predictions
## Deployment
1. Clone this repository
2. Build Docker image: `docker build -t engagement-api .`
3. Run container: `docker run -p 7860:7860 engagement-api`
## Example Usage
```python
import requests
url = "https://your-huggingface-space-url.hf.space/predict"
files = {'image': open('test.jpg', 'rb')}
response = requests.post(url, files=files)
print(response.json())
```
## Model Details
- Model: Custom TensorFlow Lite model (`engagement_model_89.tflite`)
- Input: 224x224 RGB face image
- Output: Probabilities for 4 engagement states:
- Engaged
- Frustrated
- Bored
- Confused
|