A reusable and modular Python SDK for face detection, face embedding, and face recognition built on top of InsightFace. The SDK is designed to be framework-independent, allowing it to integrate seamlessly with any backend such as Django, Flask, FastAPI, or custom Python services.
- Modular architecture with reusable components
- Strongly typed schemas using dataclasses
- Configurable InsightFace model loading
- Image preprocessing and validation
- Face detection with bounding boxes and facial landmarks
- Comprehensive unit and integration test suite
- Easy integration into existing backend applications
Image
│
▼
ImageProcessor
│
▼
Detector
│
▼
FaceDetection
- AIEngineConfig
- Constants
- Custom Exceptions
- InsightFaceLoader
- ImageProcessor
- Detector
Geometry
- Point
- BoundingBox
- FacialLandmarks
Face
- FaceDetection
- EmbeddingVector
- FaceEmbedding
- RecognitionResult
- Unit Tests
- Integration Tests
Current Status
- ✅ 43 Tests Passed
- ✅ 100% Passing Test Suite
The following components are planned:
- Embedder
- Matcher
- Recognizer
- AIEngine (high-level SDK interface)
Final pipeline:
Image
│
▼
ImageProcessor
│
▼
Detector
│
▼
FaceDetection
│
▼
Embedder
│
▼
FaceEmbedding
│
▼
Matcher
│
▼
RecognitionResult
The SDK is backend-agnostic and can be integrated into any Python backend.
Example:
from ai_engine import AIEngineConfig
from ai_engine.core import ImageProcessor, Detector
from ai_engine.models import InsightFaceLoader
config = AIEngineConfig()
model = InsightFaceLoader.get_model(config)
detector = Detector(model)
image = ImageProcessor.load("image.jpg")
detections = detector.detect(image)The returned SDK schemas can be directly serialized into JSON responses or used in business logic such as attendance systems, visitor management, authentication, or surveillance applications.
- Clean and modular architecture
- Easy to extend and maintain
- Framework-independent
- Production-ready design
- Comprehensive testing with TDD
Suresh Thevar