face_gesture_detector 0.2.3
face_gesture_detector: ^0.2.3 copied to clipboard
A widget that detects face gestures.
Changelog #
All notable changes to this project will be documented in this file.
The format loosely follows Keep a Changelog and the project adheres to Semantic Versioning.
0.2.3 #
Fixed #
- Release APK crash (R8/ProGuard): R8 class-merging optimization broke MediaPipe's JNI native library loading via stack inspection, causing
ExceptionInInitializerErrorat runtime. Added-dontoptimizeand explicit-keeprules for MediaPipe, protobuf, and plugin classes in consumer ProGuard rules. - Euler angles rotated 90°: Camera sensor orientation (
sensorOrientation=270on most front cameras) was sent from Dart but never applied on the native side. MediaPipe computed angles in raw sensor coordinates, causing pitch/yaw/roll to be misassigned (e.g. "head nod up" fired when turning right). Now compensated viacorrectAnglesForRotation()after Euler extraction. - Distance "ok" range too narrow: Default thresholds (
minDistanceRatio=0.20,maxDistanceRatio=0.60) required holding the device uncomfortably close. Relaxed to0.05/0.40for comfortable arm-length usage.
0.2.1 #
Fixed #
- Deep-cast nested platform channel maps:
FaceFrame.fromMapnow usesMap<String, dynamic>.from()for nested maps (faceBoundingBox,poseAngles,quality,blendshapes,landmarks) instead of directas Map<String, dynamic>casts that failed at runtime with_Map<Object?, Object?> - Face confidence always 0.00: The
_neutralblendshape score was incorrectly used as face detection confidence; now reports1.0when a face is detected (MediaPipe already filters byminFaceDetectionConfidence)
0.2.0 #
Added #
- Camera integration:
FaceGestureDetectoraccepts an optionalcameraControllerparameter, wiring the full camera → native → recognizer pipeline automatically - Real-time detection:
RawFaceGestureDetectormanagesstartDetection,processFrame,faceFrameStream, andstopDetectionlifecycle when aCameraControlleris provided - Example app: Fully functional demo with live front-camera preview, face detection indicator, event log, and all 10 gesture callbacks
- Integration tests: Camera pipeline tests on physical device (camera init, processFrame, faceFrameStream)
Changed #
cameraControllerparameter added toFaceGestureDetectorandRawFaceGestureDetector(optional —nullpreserves test/manual mode)camera: ^0.11.1added as a dependency- Example app requires
android.permission.CAMERA
0.1.0-dev #
Added #
- Data Model:
FaceFrame,FaceBlendshape(52 values),PoseAngles,FaceLandmark,ImageQualityMetrics - Details objects:
FaceDetectedDetails,QualityDetails,DistanceDetails,PoseDetails,BlinkDetails,SmileDetails,MouthDetails,BrowDetails,HeadTurnDetails,HeadNodDetails - Configuration:
FaceGestureConfigurationwith calibrated defaults - Platform interface:
FaceGestureDetectorPlatform+MethodChannelFaceGestureDetector+processFrame() - Recognizers:
FacePresenceRecognizer,QualityGateRecognizer,PoseRecognizer,BlinkRecognizer,SmileRecognizer,MouthRecognizer,BrowRecognizer,HeadTurnRecognizer,HeadNodRecognizer,RawFrameRecognizer - Widgets:
RawFaceGestureDetector(Layer 2),FaceGestureDetector(Layer 1 facade) - Controller:
FaceGestureDetectorControllerwith pause/resume/reset - Native Android:
FaceLandmarkerEngine(MediaPipe LIVE_STREAM + GPU delegate),EulerAngleCalculator(pitch/yaw/roll from 4×4 matrix),FrameDecoder(NV21 → MPImage),SingleSlotFrameBuffer(lock-free backpressure),FaceFrameStreamHandler(EventChannel main-thread emission),face_landmarker.taskmodel bundled - Example app: MVP with all callback families and event log
- Tests: 117 Dart unit tests, 14 Android JVM unit tests, 3 integration tests on device