face_detection_tflite
Advanced face & landmark detection, embedding and segmentation using on-device LiteRT (formerly TensorFlow Lite) models.
6.8.0
3.3K downloads/mo
#4458 most downloaded on pub.dev
hugocornellier/face_detection_tflite
What this package is like to depend on
Last release 15 days ago
08 Aug 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 84 of 84 stable releases
Nothing withdrawn
no release was ever pulled
10 months old
84 releases · first in 2025
84 releases in the last 12 months
see the full history below
Release timeline
84 releases · Oct 2025 to Aug 2026
2026
Releases
latest 60 of 84-
6.8.008 Aug 2026Release notes
Open source →- Default precision is now
Precision.fp32instead offp16. This changes numeric output.flutter_litert3.8.0 changed its own default for the same reason: across 29 published detection models measured on five GPUs, fp16 matched a plain-CPU reference for only about a fifth of them, while fp32 matched every model that compiled. These graphs emit pixel-space coordinates and landmark positions, and fp16 carries about three decimal digits of mantissa, so the error lands directly on output geometry. The cost is real and worth stating plainly: fp32 is a median 29.9% slower on GPU across those five GPUs, with Apple M4 the lone exception at 6.5% faster. Passprecision: Precision.fp16explicitly to restore the previous behaviour, ideally per model and validated on your target GPU. - Pin
flutter_litertto^3.8.0. - Rename the example app's engine badge from
CM/XNNtoCM/Interpreter.XNNPACKis only the delegate theInterpreterpath uses on desktop and Android; on iOS that path runs the Metal delegate, so anXNNlabel was wrong there. The badge switches between the twoflutter_litertengine classes,CompiledModelandInterpreter, so it now names those. The button is fixed-width so swapping labels does not shift the surrounding controls. Example-only change; no library code is affected. - Feature: opt-in temporal face tracking (
FaceDetector.create(enableTracking: true)) assigns stableFace.trackingIdvalues across sequential native and web detections. Motion-aware geometric association preserves IDs when detector ordering changes and across short detector dropouts;resetTracking()clears state when switching streams.maxMissedFrames(defaultkDefaultMaxMissedFrames, 3) sets how many processed frames a face may go undetected before its ID is retired, counted in frames the detector actually ran rather than wall-clock time, so a camera loop that drops frames while inference is busy can raise it; negative values throwArgumentErrorbefore any model loads. Tracking-enabled calls are sequenced in invocation order, and combined detection + segmentation results are tracked too. Tracking is not face recognition; default behavior remains unchanged with null IDs. - Export
kDefaultMinFacePresenceConfidence(0.5) from both entry points. It has been referenced from the public dartdoc onFaceDetector.create()andinitialize()since 6.7.0, but was never exported: the native entry listed only the model-name constants fromface_model_config.dart, and the web entry did not export that file at all. The doc links therefore dangled on pub.dev and callers could not name the default they were being documented about. Additive only; no behaviour change, and the value is unchanged at 0.5. A test now guards the export so it cannot be dropped again.
- Default precision is now
-
6.7.025 Jul 2026Release notes
Open source →- Face-presence gate (MediaPipe
min_face_presence_confidence):FaceDetector.create()/initialize()now acceptminFacePresenceConfidence, which drops detections the face-landmark model does not confirm as a face by gating the mesh "face flag" (face.meshScore). This is MediaPipe's standard second-stage check and suppresses common first-stage false positives such as a hand or palm, which clear the BlazeFace detector but score near zero on the mesh model. It defaults to0.5, matching MediaPipe (unlikeminScore/minFaceSize, which default to0.0), so upgrading turns the check on: instandard/fullmodes, detections whosemeshScoreis below0.5are no longer returned. PassminFacePresenceConfidence: 0.0to restore the previous "return every detected box" behavior. The gate has no effect infastmode (no mesh is computed), and anullmeshScorealways passes. On both native and web it runs right after the mesh stage, before iris and blendshape, so rejected faces skip that per-face landmark cost. Validated to[0.0, 1.0](out-of-range or NaN throwsArgumentError). See the README "Detection Gates" section. - Match MediaPipe's
score_clipping_threshexactly: the BlazeFace raw-logit clip limit (kRawScoreLimit) is now100.0(was80.0), matching the upstreamTensorsToDetectionsCalculator. This is numerically inert (sigmoid(80)andsigmoid(100)are both1.0in float32), so detector scores and which faces are returned are unchanged; the constant is aligned purely for exactness. - Fix (web):
activeAcceleratorchained the model runners with??, but every runner reports a non-null backend once initialized, so the chain always short-circuited on the detector model and ignored the other four. Runners compile independently and can fall back from WebGPU to WASM on their own, so when the detector is the one that falls back the aggregate reportedwasmwhile other runners were still on the GPU. Both the runtime GPU-error fallback and the slow-WebGPU warmup are gated on that value, so neither would fire for the runners still on WebGPU. Now usesaggregateActiveAcceleratorfromflutter_litert, which reportswebgpuif any runner is on it. A mixed state was observed live on Chrome (blendshapes on WASM, the rest on WebGPU). - Add
FaceDetector.acceleratorReport, a per-runner map of which backend each model actually compiled to, for diagnosing mixed WebGPU/WASM outcomes. - Adopt the shared
flutter_litert3.6.0 helpers in place of local copies:compiledModelFromBufferAutofor the{gpu, cpu}accelerator branch,compiledFloatCount/compiledSquareInputSidefor compiled tensor IO at 13 call sites, andcollectOutputShapesfor output shape collection. The local compiled-IO helpers returned a zero or negative element count for a degenerate tensor where the shared ones throw; a test asserts every bundled model reports positive float32-aligned tensor sizes, the domain where the two agree, so no model shipped here changes behaviour. - Deprecate
OutputTensorInfo,collectOutputTensorInfoandtestCollectOutputTensorInfo. Both call sites only ever read the shapes and discarded the buffers; usecollectOutputShapesfromflutter_litert. - Remove the
web_image_utilsre-export shim and import fromflutter_litertdirectly. - Update flutter_litert -> 3.6.0.
- Expand the README live camera section with the full production pipeline (frame throttling, orientation handling, cover-fit overlay mapping).
- Face-presence gate (MediaPipe
-
6.6.314 Jul 2026Release notes
Open source →- 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.211 Jul 2026 -
6.6.109 Jul 2026Release notes
Open source →- 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.
- Update flutter_litert -> 3.4.1 (web
-
6.6.005 Jul 2026Release notes
Open source →- 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.
- Update flutter_litert -> 3.3.1 (Android Gradle Plugin 9.x build fix; faster
-
6.5.028 Jun 2026Release notes
Open source →- 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.118 Jun 2026Release notes
Open source →- 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.
- Performance: when
-
6.4.017 Jun 2026Release notes
Open source →- 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.107 Jun 2026 -
6.3.030 May 2026Release notes
Open source →- 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
- Rename
-
6.2.925 May 2026Release notes
Open source →- Remove unused Darwin podspecs for Dart-only iOS/macOS plugin registration.
-
6.2.825 May 2026Release notes
Open source →- 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.723 May 2026 -
6.2.619 May 2026 -
6.2.505 May 2026Release notes
Open source →- Add Web mode GPU fallback
- Add video file processing mode to example
- Update flutter_litert -> 2.5.2
-
6.2.428 Apr 2026 -
6.2.328 Apr 2026 -
6.2.226 Apr 2026 -
6.2.124 Apr 2026 -
6.2.024 Apr 2026 -
6.1.021 Apr 2026Release notes
Open source →- 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).
- Re-export
-
6.0.017 Apr 2026Release notes
Open source →- 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
- Remove
-
5.1.415 Apr 2026 -
5.1.314 Apr 2026 -
5.1.213 Apr 2026 -
5.1.113 Apr 2026Release notes
Open source →- Add
detectFacesFromMatBytestoFaceDetector: detects faces from raw pixel data without constructing acv.Maton the calling thread (zero-copy transfer viaTransferableTypedData)
- Add
-
5.1.009 Apr 2026Release notes
Open source →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.1304 Apr 2026 -
5.0.1230 Mar 2026 -
5.0.1129 Mar 2026 -
5.0.1029 Mar 2026Release notes
Open source →- Add Windows XNNPack delegate support (2-5x inference speedup)
- Update flutter_litert 2.0.6 -> 2.0.8
-
5.0.922 Mar 2026 -
5.0.817 Mar 2026Release notes
Open source →- Fix Xcode build warnings by declaring PrivacyInfo.xcprivacy as a resource bundle in iOS and macOS podspecs
-
5.0.713 Mar 2026Release notes
Open source →- 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
- Update
-
5.0.609 Mar 2026Release notes
Open source →- Update
flutter_litert-> 1.2.0 - Refactor to use
flutter_litertshared utilities (InterpreterFactory,PerformanceConfig,generateAnchors)
- Update
-
5.0.503 Mar 2026 -
5.0.428 Feb 2026 -
5.0.326 Feb 2026 -
5.0.226 Feb 2026Release notes
Open source →- Update
flutter_litertto 0.2.2 - Add original model cards for archival and documentation
- Update
-
5.0.124 Feb 2026 -
5.0.023 Feb 2026Release notes
Open source →Breaking changes:
- Remove all deprecated
imagepackage-based APIs acrossFaceDetector,FaceDetectorIsolate,IsolateWorker, model runners (FaceDetectionModel,FaceLandmark,FaceEmbedding,IrisLandmark,SelfieSegmentation), and helper functions - Remove
imagepackage dependency
- Remove all deprecated
-
4.6.421 Feb 2026 -
4.6.317 Feb 2026Release notes
Open source →- Swift Package Manager support
- Windows: remove bundled .dll files, as they are no longer needed as of
flutter_litert0.1.4
-
4.6.213 Feb 2026Release notes
Open source →- Windows: Custom ops (segmentation) fix
- Fix heap corruption crash when switching between segmentation models
-
4.6.112 Feb 2026 -
4.6.008 Feb 2026Release notes
Open source →- 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.308 Feb 2026Release notes
Open source →- Fix Android build: bump tflite_flutter_custom to 1.2.5 (fixes undefined symbol TfLiteIntArrayCreate linker error)
-
4.5.206 Feb 2026 -
4.5.106 Feb 2026 -
4.5.006 Feb 2026Release notes
Open source →- Selfie segmentation for background removal and virtual backgrounds
- Uses MediaPipe Selfie Segmentation models (general 256×256, landscape 144×256)
-
4.4.101 Jan 2026Release notes
Open source →- Performance optimizations: pre-allocated inference buffers, early score filtering (~17× fewer box decodes), parallel multi-face processing
-
4.4.030 Dec 2025 -
4.3.024 Dec 2025Release notes
Open source →- 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)
- Face recognition via embeddings, enables comparing faces across images
-
4.2.121 Dec 2025 -
4.2.018 Dec 2025 -
4.1.016 Dec 2025Release notes
Open source →- 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
- Native image processing with opencv_dart for ~2x performance improvement via SIMD acceleration
-
4.0.005 Dec 2025Release notes
Open source →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
- Replace
-
3.1.005 Dec 2025Release notes
Open source →- 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.302 Dec 2025