face_detection_tflite 6.6.3
face_detection_tflite: ^6.6.3 copied to clipboard
Advanced face & landmark detection, embedding and segmentation using on-device TFLite models.
6.6.3 #
- Update flutter_litert -> 3.5.1.
- Performance (web): the
minScore/minFaceSizegates now filter detections before the per-face mesh, iris and blendshape stages (as on native), anddetectFacesWithSegmentationdecodes the image once instead of twice. In two interleaved 60-run A/B pairs on Chrome 149 (WASM), using a warmed threshold that retained exactly one face from a 4-face group shot, full mode dropped from 65.8-66.8 ms to 46.1-46.6 ms per call (about 30% faster) and combined detection plus segmentation from 96.8-97.7 ms to 69.2-70.7 ms (about 28% faster); ungated detection was unchanged. Detector-level outputs (scores, boxes, keypoints, which faces are returned) are bit-identical; mesh-stage values for early invocations can shift within the web runtime's pre-existing call-order jitter, which is smaller than the jitter that runtime already shows between identical calls in unchanged code. - Fix (web): a BlazeFace candidate whose decoded box was degenerate (nonpositive width or height) shifted every later candidate's box onto the wrong confidence score, corrupting weighted NMS and the reported
face.score/minScoregating for those detections. Candidate decode now keeps each box paired with its own score (decodeBlazeFaceCandidates, pure Dart and unit-tested), and NaN scores remain rejected; results are unchanged whenever no candidate was skipped, which is the common case. Native was not affected. Because the fix can change web detection output for affected inputs,FaceDetector.modelVersionis now1.1.1. - Performance: face meshes returned by the native pipeline now keep their landmark data in the packed float buffer that crossed the isolate boundary and build
Pointobjects lazily on first access (FaceMesh.packed). Callers that never readmesh.points(for example apps that only draw bounding boxes from full-mode results) skip 468 allocations per face per frame; callers that do read them get bit-identical values. Measured ~1.4% faster multi-face full-mode detection and ~3.5% faster adjacent embedding calls (less GC churn), pooled over 200 runs per side; single-face detection within noise; memory usage is equal or lower. - Performance: embedding requests (
getFaceEmbedding,getFaceEmbeddingFromMat,getFaceEmbeddingFromMatBytes,getFaceEmbeddings) now send only the two eye landmark points to the detection isolate instead of serializing the wholeFace(468-point mesh and iris data included), and embedding vectors return as typed data instead of boxed lists. The eye points are exactly whatface.landmarksreports (iris-refined when available), so embeddings are bit-identical. Measured ~4% faster pergetFaceEmbeddingcall (3.41 ms to 3.28 ms median over 100 runs, Apple Silicon, XNNPACK). - Performance: on native platforms,
minScore/minFaceSizegates now run inside the detection isolate right after the detector stage, so gated-out faces skip the per-face mesh, iris and blendshape work instead of being computed and then discarded. Detection results are byte-identical to the previous late filtering; only the wasted per-face stages are skipped. In a benchmark on a 4-face group shot with aminFaceSizekeeping one face (full mode, Apple Silicon, XNNPACK, median of 100 runs), latency dropped from ~18.0 ms to ~7.0 ms per call (about 61% faster). Ungated calls are unchanged. Adds the sharedboxVisibleWidthFractionandapplyDetectionGateshelpers;Face.widthFractionnow delegates to the former with bit-identical arithmetic.
6.6.2 #
- Update flutter_litert -> 3.5.0
6.6.1 #
- Update flutter_litert -> 3.4.1 (web
CompiledModelWebGPU compile watchdog: a compile attempt that never settles now falls back to WASM instead of hanging). No API change.
6.6.0 #
- Update flutter_litert -> 3.3.1 (Android Gradle Plugin 9.x build fix; faster
Interpreter.run/CompiledModel.runand fewer per-frame allocations in the camera YUV path). No API change. - Head pose:
Face.headEulerAngles(andheadEulerAngleX/headEulerAngleY/headEulerAngleZ) report pitch, yaw and roll in degrees, following Google ML Kit's sign conventions. Pitch/yaw come from the 3D mesh (standard/full);fastmode gives roll only. Computed on demand, so no added inference cost. - Face classification (MediaPipe Blendshape V2,
fullmode):Face.smilingProbability,leftEyeOpenProbabilityandrightEyeOpenProbability(ML Kit semantics, subject-relative left/right), plusblendshapeswith all 52 coefficients indexed by the newBlendshapeenum. Bundlesface_blendshapes.tflite(955 KB, Apache 2.0); it is a CPU-pinned MLP validated against MediaPipe's golden output, with no cost infast/standard(values arenullthere). See the README "Face Classification" section. - Named face contours (Google ML Kit
FaceContourTypeparity):Face.getContour(type)andFace.contoursreturn ordered mesh points for the face oval, eyebrows, eyes, lips, nose and cheeks, derived from MediaPipe's canonicalFACEMESH_*connection sets and exposed via the newFaceContourTypeenum andfaceContourMeshIndicestable. Requires a mesh (standard/full;nullinfast); left/right are subject-relative. See the README "Face Contours" section. - Detection gates:
FaceDetector.create()/initialize()acceptminScoreandminFaceSize(matching Google ML Kit'ssetMinFaceSizeconvention), both defaulting to0.0(no filtering) and validated to[0.0, 1.0](out-of-range or NaN throwsArgumentError). AddsFace.widthFraction(visible face width / image width), the valueminFaceSizecompares against.minScoreonly tightens results above the detector's internal0.5floor. See the README "Detection Gates" section. - Expose confidence scores:
Face.score(detector face-presence confidence) andFace.meshScore/FaceMesh.score(mesh model's confidence,nullinfast), plusFaceLandmark.callWithScore(). All from existing outputs, so no added cost. See the README "Detection Score" section. - Fix: face mesh
zis now scaled consistently withx/y(previously left in the model's input-pixel units), making the mesh usable for 3D geometry such as head pose.x/yrendering and iris landmarks are unaffected. - Overlay helpers (
DetectionsPainter,CameraDetectionPainter,FaceDetectionCameraOverlay) gain an opt-inshowPoseAndScoresflag (default false) drawing a per-face card with confidence and head-pose angles, with toggles in the example app. - Docs: documented all public enum values and added README sections for the above plus
detectFacesWithSegmentation/DetectionWithSegmentationResult.
6.5.0 #
- Update flutter_litert -> 3.2.0
- Import native-only flutter_litert APIs via
package:flutter_litert/native.dartso they resolve under static analysis (flutter_litert 3.2.0 movedInterpreterFactory,IsolateRpcClient,IsolateWorkerBase, andTensorFloat32Viewsbehind the native conditional export). No runtime or API change. - Default the public entry's conditional export to the web implementation, gating native behind
dart.library.io, restoring WASM compatibility (pub.dev WASM-ready). No behavior change on any platform. - Add
package:face_detection_tflite/face_detection_tflite_native.dart, a native-only entry point that re-exports the native implementation (isolate workers, model runners, overlay and UI helpers) for code that runs only on native platforms.
6.4.1 #
- Performance: when
getFaceEmbeddingfollowsdetectFacesFromByteson the same encoded image, the detection isolate now reuses the already-decoded image instead of decoding it a second time (one-entry cache keyed by an exact byte match). Saves a full image decode per detect+embed pair (~16 ms at 12 MP; scales with resolution). No API change, and detection and embedding results are byte-identical. The raw-pixel APIs (detectFacesFromMatBytes,getFaceEmbeddingFromMatBytes) are unaffected; the cache holds at most one decoded frame and is released on dispose.
6.4.0 #
- Update flutter_litert -> 3.1.1
- Add optional LiteRT Next
CompiledModelinference viaCompiledModel.fromBufferWithGpuFallback(GPU with automatic CPU fallback); enable withuseCompiledModel: true. The default engine remains the Interpreter, so existing code is unchanged. - Decode camera frames through the shared flutter_litert
CameraFrameDecodePlanhelper.
6.3.1 #
- Update flutter_litert -> 2.8.3
6.3.0 #
- Rename
detectFaces->detectFacesFromBytesfor clarity (input is encoded image bytes, vs. raw pixels indetectFacesFromMatBytes);detectFacesis kept as a deprecated alias and will be removed in a future release - Update flutter_litert -> 2.8.0
- Complete Swift Package Manager migration: example uses CocoaPods only for the optional MLKit comparison benchmark
6.2.9 #
- Remove unused Darwin podspecs for Dart-only iOS/macOS plugin registration.
6.2.8 #
- Update flutter_litert -> 2.5.8
- Migrate macOS to Swift Package Manager (CocoaPods no longer required)
- Update camera_desktop -> 1.1.6 in example
6.2.7 #
- Update flutter_litert -> 2.5.5
6.2.6 #
- Update flutter_litert to 2.5.3 and camera_desktop to 1.1.4
6.2.5 #
- Add Web mode GPU fallback
- Add video file processing mode to example
- Update flutter_litert -> 2.5.2
6.2.4 #
- Update flutter_litert -> 2.5.0
6.2.3 #
- Update flutter_litert -> 2.4.1
6.2.2 #
- Simplify and DRY example app, extract utility helpers
6.2.1 #
- Update documentation
6.2.0 #
- Update flutter_litert to 2.4.0
6.1.1 #
- Update flutter_litert to 2.2.1
6.1.0 #
- Re-export
packYuv420,YuvPlane,YuvLayout, andPackedYuvfromflutter_litertso live-camera consumers can reach the helper through theface_detection_tflitebarrel without a directflutter_litertimport. - Update
flutter_litertto^2.2.0 - Add
FaceDetector.modelVersionconstant so consumers that persist detection results have a stable cache-invalidation key. Bumped on changes that alter detection output (model swaps, threshold or preprocessing changes); unchanged across pure refactors or API additions. - Rewrite the README's Live Camera and Direct Mat Input sections around
packYuv420so every snippet is a real compilable example (no ghostconvertCameraImageToMat, no duplicatesegmentervariable, nocv.Mattype annotations requiring an unlisted import).
6.0.1 #
- Fix Android live camera overlay in the example app (#8):
- Replace the per-pixel Dart YUV→BGR loop with
flutter_litert's sharedpackYuv420helper + nativecv.cvtColor(~5-10x faster on Android). - Correct the rotation direction for
sensorOrientation90° / 270° to match the Android CameraX convention. - Mirror the detection overlay on Android front camera to match
CameraPreview's auto-mirrored preview texture.
- Replace the per-pixel Dart YUV→BGR loop with
- Add option to toggle between front/back camera in example app (mobile only)
6.0.0 #
- Remove
FaceDetectorIsolate-FaceDetectoris now the single unified class running all inference in a background isolate - Remove
irisOkCountandirisFailCount(were deprecated in 5.1.0) FaceDetector()constructor is now public;initialize()replaces the oldspawn()factoryinitialize()gainswithSegmentationandsegmentationConfigparametersinitializeSegmentation()no longer requires re-spawning the detection isolate- Add
getFaceEmbeddingFromMatBytesto mirrordetectFacesFromMatBytesfor callers with pre-decoded pixel data - Improve
getFaceEmbeddingFromMatperformance by transferring raw pixel bytes to the background isolate instead of re-encoding
5.1.4 #
- Update flutter_litert to 2.0.13
5.1.3 #
- Update flutter_litert -> 2.0.12
5.1.2 #
- Update
detectFacesFromMatBytesdocumentation
5.1.1 #
- Add
detectFacesFromMatBytestoFaceDetector: detects faces from raw pixel data without constructing acv.Maton the calling thread (zero-copy transfer viaTransferableTypedData)
5.1.0 #
FaceDetectornow runs all inference in a background isolate automatically, matchingFaceDetectorIsolateperformancedispose()is nowFuture<void>(wasvoid), existing code compiles but should be awaited- Deprecate
FaceDetectorIsolate: useFaceDetectorinstead - Deprecate
irisOkCountandirisFailCount(not trackable across isolate boundaries) - Add
detectFacesWithSegmentationanddetectFacesWithSegmentationFromMattoFaceDetector
5.0.13 #
- Update flutter_litert 2.0.10 -> 2.0.11
5.0.12 #
- Update documentation
5.0.11 #
- Update flutter_litert 2.0.8 -> 2.0.10
5.0.10 #
- Add Windows XNNPack delegate support (2-5x inference speedup)
- Update flutter_litert 2.0.6 -> 2.0.8
5.0.9 #
- Update flutter_litert 2.0.5 -> 2.0.6
5.0.8 #
- Fix Xcode build warnings by declaring PrivacyInfo.xcprivacy as a resource bundle in iOS and macOS podspecs
5.0.7 #
- Update
camera_desktop1.0.1 -> 1.0.3 - Use shared
PointandBoundingBoxfromflutter_litert2.0.0 - Refactor isolate worker to use
IsolateWorkerBasefrom flutter_litert - Consolidate NMS helpers, extract shared
_buildPersonMaskand_irisCenterFromPoints - Deduplicate
FaceDetectorandFaceDetectorIsolateinternals
5.0.6 #
- Update
flutter_litert-> 1.2.0 - Refactor to use
flutter_litertshared utilities (InterpreterFactory,PerformanceConfig,generateAnchors)
5.0.5 #
- Update
opencv_dart2.1.0 -> 2.2.1 - Update
flutter_litert1.0.2 -> 1.0.3
5.0.4 #
- Update
flutter_litert1.0.1 -> 1.0.2
5.0.3 #
- Update
camera0.11.3 -> 0.12.0 - Update
flutter_litert0.2.2 -> 1.0.1
5.0.2 #
- Update
flutter_litertto 0.2.2 - Add original model cards for archival and documentation
5.0.1 #
- Migrate iOS CocoaPods -> Swift Package Manager
5.0.0 #
Breaking changes:
- Remove all deprecated
imagepackage-based APIs acrossFaceDetector,FaceDetectorIsolate,IsolateWorker, model runners (FaceDetectionModel,FaceLandmark,FaceEmbedding,IrisLandmark,SelfieSegmentation), and helper functions - Remove
imagepackage dependency
4.6.4 #
- Update flutter_litert to 0.1.12
4.6.3 #
- Swift Package Manager support
- Windows: remove bundled .dll files, as they are no longer needed as of
flutter_litert0.1.4
4.6.2 #
- Windows: Custom ops (segmentation) fix
- Fix heap corruption crash when switching between segmentation models
4.6.1 #
- Migrate from
tflite_flutter_customtoflutter_litert
4.6.0 #
- Fix FaceDetectorIsolate hang on Android during batch face embeddings
- 3-4x performance improvement for FaceDetectorIsolate by eliminating redundant nested isolates
- Models inside worker isolates now invoke TFLite directly instead of routing through nested IsolateInterpreters
4.5.3 #
- Fix Android build: bump tflite_flutter_custom to 1.2.5 (fixes undefined symbol TfLiteIntArrayCreate linker error)
4.5.2 #
- Fix bug causing auto-bundling to fail on MacOS
4.5.1 #
- Update all dependencies to latest version(s)
4.5.0 #
- Selfie segmentation for background removal and virtual backgrounds
- Uses MediaPipe Selfie Segmentation models (general 256×256, landscape 144×256)
4.4.1 #
- Performance optimizations: pre-allocated inference buffers, early score filtering (~17× fewer box decodes), parallel multi-face processing
4.4.0 #
- Fixes #3: bug causing crash on non-XNNPack compatible Android devices
4.3.0 #
- Face recognition via embeddings, enables comparing faces across images
getFaceEmbedding()/getFaceEmbeddings()methods onFaceDetectorandFaceDetectorIsolatecompareFaces()for cosine similarity,faceDistance()for Euclidean distance- Uses MobileFaceNet model (~5MB, ~18ms inference)
4.2.1 #
- Fix crash on Windows platforms
4.2.0 #
- Add FaceDetectorIsolate for background thread detection
4.1.1 #
- Re-implement parallel iris inference using native image processing
4.1.0 #
- Native image processing with opencv_dart for ~2x performance improvement via SIMD acceleration
detectFaces()now uses OpenCV internally- New
detectFacesFromMat()method for camera streams (avoids repeated encode/decode overhead)
- XNNPACK delegate enabled by default for 2-5x CPU speedup (use
PerformanceConfig.disabledto opt out) - Benchmark tests
4.0.0 #
Breaking changes:
- Replace
math.Point<double>type references withPoint - Change
face.mesh.isEmptytoface.mesh == null - Access mesh points via
face.mesh?.points[i]orface.mesh?[i] - Replace
face.irises→face.eyes - Replace
IrisPair→EyePair - Replace
iris.center→eye.irisCenter - Replace
iris.contour→eye.irisContour
Improvements:
- Performance and speed improvements
- Optimize bilinear sampling with direct buffer access, 20-40% speed improvement
- Fast-path frame registration
- Parallel iris refinement
- Isolate-based image-to-tensor conversion.
- Improved test suite, added integration tests
3.1.0 #
- EyePair class and eye mesh landmarks (71 points per eye)
- Add
contourgetter for accessing visible eyelid outline (first 15 of 71 points) - Add
eyeLandmarkConnectionsconstant for rendering connected eyelid outline - Add
kMaxEyeLandmarkconstant defining eyeball contour point count
3.0.3 #
- Guard iris ROI size and fall back when eye crop collapses
3.0.2 #
- Add frame registration fast path to reduce transfers
- Parallel iris refinement for multi-face
- Cache input tensor buffers in FaceDetection, FaceLandmark, and IrisLandmark
3.0.1 #
- Performance improvement: Optimize full mode by reusing mesh and iris landmarks
- Add pub.dev score and version to README
3.0.0 #
This version contains breaking changes.
- Remove deprecated bboxCorners and landmarksMap. The new BoundingBox and FaceLandmarks class should be used instead.
- Rename bbox to boundingBox.
2.2.1 #
- FaceLandmarks class instead of Map
- Simplified process of accessing individual landmarks
2.2.0 #
- BoundingBox class
- Add clarification to README about dart:math requirement for Point
2.1.3 #
- Bundle Point from dart:math with library
- Improved dartdocs
2.1.2 #
- Fix bug in example related to overlay rect scaling
2.1.1 #
- Added missing dartdoc for entry point lib/face_detection_tflite.dart and RectF constructor in lib/src/types_and_consts.dart
2.1.0 #
- New IrisPair class
- Add structured iris types, rename raw iris points
- Update example, README usage examples
2.0.3 #
- Add Dartdocs for AlignedFace, AlignedRoi, DecodedBox, DecodedRgb
- Minor clarifications to existing getDetectionsWithIrisCenters and RectF Dartdocs
- Improved examples in README
2.0.2 #
- Swift Package Manager support
2.0.1 #
- Update tflite_flutter_custom to 1.0.3, equivalent to tflite_flutter 0.12.1.
- Improved dartdocs
2.0.0 #
This version contains breaking changes.
- detectFaces now returns List
- Public types renamed/privatized (FaceIndex is now FaceLandmarkType, RectF/Detection/ AlignedFace/AlignedRoi now internal).
- Landmark maps now keyed by FaceLandmarkType
- Full dartdoc coverage
1.0.3 #
- Update tflite_flutter_custom to 1.0.1, equivalent to tflite_flutter 0.12.0.
- Unit tests
- Performance optimization(s) by enabling parallel inferences in images with multiple faces
1.0.2 #
- Three detection modes: fast, standard & full. Enables faster inferences when the full detection set is not needed.
1.0.1 #
- Improved error handling
- Added samples, improved documentation
- Improved example (see example tab on pub.dev)
1.0.0 #
- Provide end-user with pre-normalized, image-space coords.
- Improved readme/documentation & public API as a whole,
- Removed obsolete methods, change Offset objects to Point.
0.1.6 #
- Fix bug where IrisLandmark inferences would fail in an Isolate
0.1.5 #
- Moved heavy operations to Isolates to avoid UI clank/lag
0.1.4 #
- Refresh iOS/Android example project files to avoid stale tool warnings.
0.1.3 #
- Tweak analysis/lints config to match latest Flutter stable.
0.1.2 #
- Minor bug fixes & improvements
- Clarifications in the README
0.1.1 #
- Add iOS and Android via
dartPluginClass - Keep native plugin on desktop (macOS/Windows/Linux) so CMake still bundles TFLite C libs.
- Note: iOS release builds may require Xcode “Strip Style = Non-Global Symbols”; test on device (not simulator).
- Note: Android requires minSdk 26 (handled by the app).
0.1.0+1 #
- Initial public release of
face_detection_tflite. - Includes TFLite face detection + landmarks models and platform shims.
- Adds prebuilt
libtensorflowlite_cfor macOS/Windows/Linux.