face_plugin 0.0.2
face_plugin: ^0.0.2 copied to clipboard
Face detection and feature extraction plugin using MobileFaceNet for Android and iOS. Provides 128-dimensional face feature vectors for face recognition and comparison.
Changelog #
All notable changes to this project will be documented in this file.
0.0.2 - 2026-04-24 #
Added #
Face.landmarkCount— number of landmarks actually detected by ML Kit (0–5). Use as a quality gate to filter false-positive detections.Face.headEulerAngleX/Y/Z— head pose angles from ML Kit (pitch / yaw / roll, degrees). Useful for rejecting non-frontal faces before feature extraction.
Changed #
Face.faceScoreis nowlandmarkCount / 5.0(real quality signal) instead of a hardcoded1.0.Face.faceTvreturns-1(not0) when ML Kit tracking is unavailable, avoiding confusion with a realtrackingId = 0.- Android:
FEATURE_DIMchanged from astaticfield to an instance field so each plugin instance independently auto-detects the model output shape on attach. Fixes a shape mismatch crash ([1,192] vs [1,128]) on models with 192-dim output. - Android:
detectFacesandextractFeaturesnow decode the image and run ML Kit on a backgroundExecutorServicethread, with results posted back to the main thread. Eliminates potential "Must not be called on the main application thread" errors and keeps large-image decoding off the UI thread. - Cleaned up documentation: removed all intermediate dev/debug markdown files.
The repository now contains only
README.mdandCHANGELOG.md.
Fixed #
- Unit tests (
test/) rewrote to cover the actualdetectFaces/extractFeaturesAPI instead of the removedgetPlatformVersion()stub. - Integration test (
example/integration_test/) updated accordingly.
0.0.1 - 2026-04-07 #
Added #
- Initial release of face_plugin
- Face detection with bounding boxes and facial landmarks (5 key points)
- Feature extraction using MobileFaceNet (128-dimensional vectors)
- Complete Android implementation (Java + TensorFlow Lite 2.14.0)
- Complete iOS implementation (Swift + TensorFlow Lite 2.14.0)
- Cross-platform API through Method Channel
- Comprehensive documentation (README, QUICK_START, MODEL_GUIDE, PROJECT_SUMMARY)
- Example application with UI demonstration
- Support for image preprocessing (resize to 112x112, normalization)
Features #
detectFaces(Uint8List imageBytes)- Detect faces in imagesextractFeatures(Uint8List imageBytes)- Extract 128-D feature vectors- Face model with bounding boxes, 5 facial landmarks, and confidence scores
Platform Support #
- Android: minSdk 21 (Android 5.0+)
- iOS: 12.0+
- Flutter: >=3.3.0
Dependencies #
- TensorFlow Lite 2.14.0 for both platforms
- plugin_platform_interface ^2.0.2
Notes #
- Current implementation uses simplified face detection (for demonstration)
- For production, integrate professional face detection (ML Kit, MTCNN, Vision Framework)
- Feature extraction is production-ready using MobileFaceNet
- Requires mobilefacenet.tflite model file (not included, see MODEL_GUIDE.md)