gaze-emotion-api / README.md
pranavinani
Resolve merge conflict and add API files
02fabf3
---
title: Gaze and Emotion Detection API
emoji: 👁️
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
license: mit
short_description: Real-time gaze tracking and emotion detection API
---
# Gaze and Emotion Detection API
This API provides real-time gaze tracking and emotion detection from images using MediaPipe and DeepFace.
## Features
- Face detection and tracking
- Gaze direction estimation (LEFT, RIGHT, UP, DOWN, CENTER)
- Emotion recognition (happy, sad, angry, fear, surprise, disgust, neutral)
- Concentration score calculation
- Blink detection
## API Endpoints
- `GET /` - Health check
- `POST /analyze` - Upload image for analysis
## Usage
Send a POST request to `/analyze` with an image file to get gaze and emotion data in JSON format.
### Example Response:
```json
{
"emotion": "happy",
"face_detected": true,
"gaze_direction": "CENTER",
"concentration_score": 85.5,
"blinking": false,
"gaze_positions": {
"left_eye": {"horizontal": 0.45, "vertical": 0.52},
"right_eye": {"horizontal": 0.48, "vertical": 0.50}
}
}
```
## Testing
You can test the API using the interactive documentation at `/docs` endpoint.