algoryn/validation
0
๐ Gesture Detection & Identity Validation API
A unified API for gesture detection in videos and identity validation using facial recognition and gesture verification.
๐ Features
- Gesture Detection: Detect and track hand gestures in video files
- Identity Validation: Validate user identity using facial recognition and required gestures
- Real-time Processing: Efficient video processing with configurable frame skip
- RESTful API: Clean, documented API endpoints
๐ API Endpoints
GET /
Get API information and available endpoints
GET /health
Health check endpoint showing service status
POST /gestures
Detect gestures in an uploaded video file
Parameters:
video(file): Video file to processframe_skip(int, optional): Number of frames to skip (default: 1)
Response:
{
"gestures": [
{
"gesture": "thumbs_up",
"duration": 45,
"confidence": 0.92
}
]
}POST /validate
Validate user identity using facial recognition and gesture verification
Parameters:
photo(file): ID document photovideo(file): User video containing face and gesturesgestures(JSON array): Required gestures (e.g.,["thumbs_up","peace"])error_margin(float, optional): Error margin for validation (default: 0.33)require_all_gestures(bool, optional): Whether all gestures must be presentsimilarity_threshold(float, optional): Facial similarity thresholdinclude_details(bool, optional): Include detailed validation results
Response:
{
"face": true,
"gestures": true,
"overall": true,
"status": "success",
"processing_time_ms": 6925,
"timestamp": "2025-09-30T08:30:22Z"
}๐ฏ Supported Gestures
thumbs_up(๐)peace(โ๏ธ)ok_sign(๐)open_palm(๐)call_me(๐ค)grabbing(โ)
๐ Documentation
Interactive API documentation is available at:
- Swagger UI:
/docs - ReDoc:
/redoc
๐ง Usage Example
# Detect gestures in a video
curl -X POST http://localhost:7860/gestures \
-F "video=@my_video.mp4" \
-F "frame_skip=3"
# Validate identity
curl -X POST http://localhost:7860/validate \
-F "photo=@id_photo.jpg" \
-F "video=@user_video.mp4" \
-F 'gestures=["thumbs_up","peace"]' \
-F "include_details=true"๐๏ธ Technology Stack
- Framework: FastAPI
- ML Models: ONNX Runtime
- Computer Vision: OpenCV
- Tracking: OCSort with Kalman filters
- Facial Recognition: Custom embeddings module
๐ Note
Facial validation is currently in placeholder mode and always returns success. Gesture validation is fully functional.
๐ License
MIT License - See LICENSE file for details
