Face Recognition Kit
Face Recognition Kit is a high-performance, professional-grade Flutter SDK designed for real-time facial detection and precision biometric identification. Built with a Crop-First Alignment Engine, it provides industry-leading accuracy for attendance systems, secure kiosks, and proctoring applications.
π Compatibility Matrix
| Platform | Support | Min. OS Version | Hardware/Feature Requirements |
|---|---|---|---|
| Android | β | API 21+ (Lollipop) | Camera support, OpenGL ES 3.0+ |
| iOS | β | iOS 12.0+ | ARM64 Architecture (Physical device recommended) |
| Web | β | Modern Browsers | WASM support, SharedArrayBuffer (for MediaPipe) |
| Flutter | β | ^3.35.0 | Stable channel recommended |
π Key Professional Features
- 192D Biometric Distillation: High-dimensional vector extraction for lighting-invariant matching.
- Precision Alignment Engine: Intelligent "Crop-then-Rotate" pipeline that eliminates coordinate drift.
- Real-Time Enrollment Guidance: UX-optimized overlays guiding users to "Look Straight" or "Move Closer".
- Neural Engine Diagnostics: Real-time detection of missing AI models with actionable developer warnings.
- Unified Multi-Platform API: Consistent behavior across Android, iOS, and Web.
- Production-Ready Components: Pre-built
FaceScannerViewandRecognitionDialogfor rapid deployment.
ποΈ Technical Architecture
The SDK uses a multi-stage pipeline to ensure biometric integrity:
graph TD
A[Camera Stream] --> B[ML Kit / MediaPipe Detection]
B --> C{Quality Gate}
C -- "Centered? Eyes Open?" --> D[Precision Crop Engine]
C -- "Fail" --> E[Real-Time Guidance UI]
D --> F[192D Neural Distillation]
F --> G[Euclidean Distance Matching]
G --> H[Identity Verified]
π¦ Installation & Setup
1. Add Dependency
dependencies:
face_recognition_kit: ^1.2.0
2. Biometric Model Setup (CRITICAL)
The SDK requires a mobile_facenet.tflite model.
- Create
assets/models/in your project root. - Place your TFLite model file there.
- Update
pubspec.yaml:
flutter:
assets:
- assets/models/mobile_facenet.tflite
π οΈ Implementation Guide
Basic Scanner Implementation
Deploy a full-featured biometric scanner in minutes.
FaceScannerView(
detector: FaceDetectorInterface(),
recognizer: FaceRecognizerInterface(),
profiles: myRegistry, // List<FaceProfile>
enableDefaultDialog: true,
onFaceRecognized: (profile, image) {
print("Welcome back, ${profile.name}");
},
)
Advanced UI Customization
Tailor the recognition experience to your brand.
FaceScannerView(
// ... engines ...
dialogOptions: RecognitionDialogOptions(
primaryColor: Colors.indigo,
successTitle: "Access Granted",
welcomeMessage: "Hello, {name}!",
displayDuration: Duration(seconds: 3),
),
guidanceOptions: FaceGuidanceOptions(
enabled: true,
stayStillMessage: "Analysing biometrics...",
moveCloserMessage: "Please center your face",
// Custom UI Overlay Builder
guidanceBuilder: (context, message) => MyCustomOverlay(text: message),
),
)
βοΈ API Reference
FaceScannerView
| Property | Type | Description |
|---|---|---|
detector |
FaceDetectorInterface |
The engine responsible for localizing faces. |
recognizer |
FaceRecognizerInterface |
The engine responsible for biometric extraction. |
profiles |
List<FaceProfile> |
Known identities to match against. |
captureOnlyFace |
bool |
If true, returns only the cropped face image in callbacks. |
onFaceDetected |
Function(FaceData, Uint8List) |
Triggered on every frame a face meets quality standards. |
FaceGuidanceOptions
| Property | Default | Description |
|---|---|---|
rotationThreshold |
15.0 |
Maximum allowed head tilt (degrees) for capture. |
eyeOpenThreshold |
0.4 |
Minimum probability for eyes to be considered open. |
brightnessThreshold |
40.0 |
Minimum average frame brightness required. |
ποΈ Full Implementation Example
This example shows how to integrate the SDK with a standard identity provider and state management system.
import 'package:face_recognition_kit/face_recognition_kit.dart';
class BiometricAuthPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FaceScannerView(
detector: FaceDetectorInterface(),
recognizer: FaceRecognizerInterface(),
profiles: userStore.allProfiles, // List<FaceProfile> from your backend
enableDefaultDialog: true,
captureOnlyFace: true,
// Customising the UI guidance
guidanceOptions: FaceGuidanceOptions(
enabled: true,
moveCloserMessage: "Align face for verification",
),
// Triggered on successful match
onFaceRecognized: (profile, image) {
handleLoginSuccess(profile);
},
// Triggered on every valid face detection (useful for enrollment)
onFaceDetected: (face, image) {
if (isEnrollmentMode) saveBiometric(face, image);
},
);
}
}
π‘ Best Practices for 99.9% Accuracy
- Lighting: Ensure even lighting on the face. Avoid strong backlighting (windows behind the user).
- Distance: Users should hold the device at a natural arm's length (Face filling ~30% of the frame).
- Registry Hygiene: Ensure the registered biometric profile is captured in good lighting with an upright head.
- Mirroring: Use
FaceScannerViewdefaultsβit automatically handles front-camera mirroring correction.
β Production Checklist
Before publishing your application, ensure the following are met:
Model Asset:mobile_facenet.tfliteis placed inassets/models/.Release Mode: Test the engine influtter run --releasefor optimal neural performance.Android Min SDK: EnsureminSdkVersion 21is set inbuild.gradle.iOS Privacy Keys:NSCameraUsageDescriptionadded toInfo.plist.Registry Prep: Train users to register in stable, front-lit environments for 99.9% consistency.
π Real-Life Use Cases
- Attendance Systems: Contactless clock-in/out for modern offices and classrooms.
- Biometric Security: Adding identity verification to sensitive app features or financial transactions.
- AI Proctoring: Continuous verification for secure remote examinations.
- Personalized Kiosks: Recognizing and greeting customers at smart retail terminals.
π License
MIT Licensed. Developed for high-security biometric ecosystems.