File size: 1,758 Bytes
09405db
12d0de7
 
 
 
09405db
 
12d0de7
09405db
 
12d0de7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
title: Face Recognition API
emoji: πŸ‘οΈ
colorFrom: purple
colorTo: blue
sdk: docker
pinned: false
license: mit
---

# Face Recognition API with FastAPI

A real-time face detection and recognition API with WebSocket support for streaming video frames.

## Features

- 🎯 **Face Detection**: MTCNN or YOLO face detection
- πŸ” **Face Recognition**: FaceNet embeddings with ChromaDB vector storage
- πŸ“‘ **WebSocket Streaming**: Real-time face detection over WebSockets
- πŸ–ΌοΈ **REST API**: Embed, update, delete, and recognize faces
- 🎨 **Data Augmentation**: Automatic face augmentation for better recognition
- πŸ“Š **Live Demo UI**: Built-in HTML interface for testing

## Quick Start

1. Access the API at the public URL provided by Hugging Face Spaces
2. Use the built-in UI at `/AutoProctor/v1/` for live testing
3. Check API docs at `/docs` for Swagger documentation

## API Endpoints

### Base Endpoints
- `GET /AutoProctor/v1/` - Web interface for testing
- `GET /AutoProctor/v1/health` - Health check
- `GET /AutoProctor/v1/config` - Get current configuration
- `GET /AutoProctor/v1/count` - Count stored embeddings

### Face Management
- `POST /AutoProctor/v1/data/embed/{user_id}` - Add face embeddings
- `POST /AutoProctor/v1/data/update/{user_id}` - Update face embeddings
- `POST /AutoProctor/v1/data/delete/{user_id}` - Delete user embeddings

### Recognition
- `POST /AutoProctor/v1/data/detect/frame` - Detect faces in single frame
- `POST /AutoProctor/v1/data/recognize/frame` - Recognize face in frame
- `WebSocket /AutoProctor/v1/data/detect/stream` - Real-time streaming

## Example Usage

### Add Face Embedding
```bash
curl -X POST "https://your-space.hf.space/AutoProctor/v1/data/embed/user123" \
  -F "file=@face.jpg"