NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #4771 most downloaded on pub.dev
Advanced face & landmark detection, embedding and segmentation using on-device LiteRT (formerly TensorFlow Lite) models.
Last release 13 days ago
25 Sep 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
1 years old
87 releases · first in 2025
detectFacesFromCameraImage now reads a desktop frame's byte order from CameraImage.format.raw instead of assuming BGRA only on macOS, so camera stream
detectFacesFromCameraImage now reads a desktop frame's byte order from
CameraImage.format.raw instead of assuming BGRA only on macOS, so camera
streams decode correctly on camera_desktop 2.0.0 (BGRA on every desktop
platform) as well as 1.x (RGBA on Linux and Windows). Linux and Windows
frames from camera_desktop 2.0.0 were previously decoded with red and blue
swapped. Other format.raw values keep the old default, and an explicit
isBgra still wins, so drop any isBgra: Platform.isMacOS you pass.flutter_litert ^3.9.2, which provides the frame-based default.
The re-exported prepareCameraFrameFromImage uses it too, so frames prepared
for detectFacesFromCameraFrame or
detectFacesWithSegmentationFromCameraFrame decode correctly as well.camera_desktop ^2.0.0.Depend on flutter_litert ^3.9.1, which updates Android's CompiledModel runtime to LiteRT Next 2.2.0 and the web runtime to LiteRT.js 2.5.3.
flutter_litert ^3.9.1, which updates Android's CompiledModel
runtime to LiteRT Next 2.2.0 and the web runtime to LiteRT.js 2.5.3.camera_desktop ^1.2.2.One column per month.
Depend on flutter_litert ^3.9.0, opencv_dart ^2.2.2, and dartcv4 ^2.3.1. The direct dartcv4 constraint exists only so resolution can never keep a dart
Depend on flutter_litert ^3.9.0, opencv_dart ^2.2.2, and dartcv4 ^2.3.1.
The direct dartcv4 constraint exists only so resolution can never keep a
dartcv4 release whose iOS CMake hook hardcodes a 12.0 deployment target,
which Xcode 27 rejects; no Dart source imports it.
Also require hooks ^2.0.0. The dartcv4 2.3.1 link hook uses the hooks 2.x
LinkInput API but still accepts hooks 1.x, so a lockfile that kept hooks
1.x failed every profile and release build with a recordedUses compile
error. The floor makes pub get move hooks forward (and with it
code_assets and objective_c). No Dart source imports it either.
Raise the Flutter floor to 3.47.5. Earlier Flutter releases pin meta 1.18.0
through flutter_test, which cannot coexist with dartcv4 2.3.1.
Building for iOS with Xcode 27 needs an iOS 15 deployment target. Set the
Runner target (and platform :ios in the Podfile) to 15.0 or newer and add
this to the app's pubspec.yaml; hook user-defines are only honoured from
the root package, so a dependency cannot supply it for you:
hooks:
user_defines:
dartcv4:
ios:
deployment_target: '15.0'
Run flutter clean afterwards so the cached OpenCV build is regenerated.
Remove the unused direct meta dependency.
No API changes. Verified with the hosted flutter_litert 3.9.0 on macOS 27,
Xcode 27, and the iOS 27 simulator.
Default precision is now `Precision.fp32` instead of `fp16`. This changes numeric output. flutter_litert 3.8.0 changed its own default for the same re
Precision.fp32 instead of fp16. This changes
numeric output. flutter_litert 3.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. Pass
precision: Precision.fp16 explicitly to restore the previous behaviour,
ideally per model and validated on your target GPU.flutter_litert to ^3.8.0.CM / XNN to
CM / Interpreter. XNNPACK is only the delegate the Interpreter path
uses on desktop and Android; on iOS that path runs the Metal delegate, so an
XNN label was wrong there. The badge switches between the two
flutter_litert engine classes, CompiledModel and Interpreter, 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.FaceDetector.create(enableTracking: true)) assigns stable Face.trackingId values 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 (default kDefaultMaxMissedFrames, 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 throw ArgumentError before 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.kDefaultMinFacePresenceConfidence (0.5) from both entry points. It has been referenced from the public dartdoc on FaceDetector.create() and initialize() since 6.7.0, but was never exported: the native entry listed only the model-name constants from face_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.Deprecate OutputTensorInfo, collectOutputTensorInfo and testCollectOutputTensorInfo. Both call sites only ever read the shapes and discarded the buffe…
min_face_presence_confidence): FaceDetector.create() / initialize() now accept minFacePresenceConfidence, 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 to 0.5, matching MediaPipe (unlike minScore/minFaceSize, which default to 0.0), so upgrading turns the check on: in standard/full modes, detections whose meshScore is below 0.5 are no longer returned. Pass minFacePresenceConfidence: 0.0 to restore the previous "return every detected box" behavior. The gate has no effect in fast mode (no mesh is computed), and a null meshScore always 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 throws ArgumentError). See the README "Detection Gates" section.score_clipping_thresh exactly: the BlazeFace raw-logit clip limit (kRawScoreLimit) is now 100.0 (was 80.0), matching the upstream TensorsToDetectionsCalculator. This is numerically inert (sigmoid(80) and sigmoid(100) are both 1.0 in float32), so detector scores and which faces are returned are unchanged; the constant is aligned purely for exactness.activeAccelerator chained 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 reported wasm
while 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 uses aggregateActiveAccelerator
from flutter_litert, which reports webgpu if any runner is on it. A mixed
state was observed live on Chrome (blendshapes on WASM, the rest on WebGPU).FaceDetector.acceleratorReport, a per-runner map of which backend each
model actually compiled to, for diagnosing mixed WebGPU/WASM outcomes.flutter_litert 3.6.0 helpers in place of local copies:
compiledModelFromBufferAuto for the {gpu, cpu} accelerator branch,
compiledFloatCount / compiledSquareInputSide for compiled tensor IO at 13
call sites, and collectOutputShapes for 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.OutputTensorInfo, collectOutputTensorInfo and
testCollectOutputTensorInfo. Both call sites only ever read the shapes and
discarded the buffers; use collectOutputShapes from flutter_litert.web_image_utils re-export shim and import from flutter_litert
directly.Update flutter_litert -> 3.5.1.
minScore/minFaceSize gates now filter detections before the per-face mesh, iris and blendshape stages (as on native), and detectFacesWithSegmentation decodes 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.face.score/minScore gating 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.modelVersion is now 1.1.1.Point objects lazily on first access (FaceMesh.packed). Callers that never read mesh.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.getFaceEmbedding, getFaceEmbeddingFromMat, getFaceEmbeddingFromMatBytes, getFaceEmbeddings) now send only the two eye landmark points to the detection isolate instead of serializing the whole Face (468-point mesh and iris data included), and embedding vectors return as typed data instead of boxed lists. The eye points are exactly what face.landmarks reports (iris-refined when available), so embeddings are bit-identical. Measured ~4% faster per getFaceEmbedding call (3.41 ms to 3.28 ms median over 100 runs, Apple Silicon, XNNPACK).minScore/minFaceSize gates 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 a minFaceSize keeping 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 shared boxVisibleWidthFraction and applyDetectionGates helpers; Face.widthFraction now delegates to the former with bit-identical arithmetic.* Update flutter_litert -> 3.5.0
Update flutter_litert -> 3.4.1 (web CompiledModel WebGPU compile watchdog: a compile attempt that never settles now falls back to WASM instead of hang
CompiledModel WebGPU compile watchdog: a compile attempt that never settles now falls back to WASM instead of hanging). No API change.Update flutter_litert -> 3.3.1 (Android Gradle Plugin 9.x build fix; faster Interpreter.run/CompiledModel.run and fewer per-frame allocations in the c
Interpreter.run/CompiledModel.run and fewer per-frame allocations in the camera YUV path). No API change.Face.headEulerAngles (and headEulerAngleX/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); fast mode gives roll only. Computed on demand, so no added inference cost.full mode): Face.smilingProbability, leftEyeOpenProbability and rightEyeOpenProbability (ML Kit semantics, subject-relative left/right), plus blendshapes with all 52 coefficients indexed by the new Blendshape enum. Bundles face_blendshapes.tflite (955 KB, Apache 2.0); it is a CPU-pinned MLP validated against MediaPipe's golden output, with no cost in fast/standard (values are null there). See the README "Face Classification" section.FaceContourType parity): Face.getContour(type) and Face.contours return ordered mesh points for the face oval, eyebrows, eyes, lips, nose and cheeks, derived from MediaPipe's canonical FACEMESH_* connection sets and exposed via the new FaceContourType enum and faceContourMeshIndices table. Requires a mesh (standard/full; null in fast); left/right are subject-relative. See the README "Face Contours" section.FaceDetector.create() / initialize() accept minScore and minFaceSize (matching Google ML Kit's setMinFaceSize convention), both defaulting to 0.0 (no filtering) and validated to [0.0, 1.0] (out-of-range or NaN throws ArgumentError). Adds Face.widthFraction (visible face width / image width), the value minFaceSize compares against. minScore only tightens results above the detector's internal 0.5 floor. See the README "Detection Gates" section.Face.score (detector face-presence confidence) and Face.meshScore / FaceMesh.score (mesh model's confidence, null in fast), plus FaceLandmark.callWithScore(). All from existing outputs, so no added cost. See the README "Detection Score" section.z is now scaled consistently with x/y (previously left in the model's input-pixel units), making the mesh usable for 3D geometry such as head pose. x/y rendering and iris landmarks are unaffected.DetectionsPainter, CameraDetectionPainter, FaceDetectionCameraOverlay) gain an opt-in showPoseAndScores flag (default false) drawing a per-face card with confidence and head-pose angles, with toggles in the example app.detectFacesWithSegmentation / DetectionWithSegmentationResult.Import native-only flutter_litert APIs via package:flutter_litert/native.dart so they resolve under static analysis (flutter_litert 3.2.0 moved Interp
package:flutter_litert/native.dart so they resolve under static analysis (flutter_litert 3.2.0 moved InterpreterFactory, IsolateRpcClient, IsolateWorkerBase, and TensorFloat32Views behind the native conditional export). No runtime or API change.dart.library.io, restoring WASM compatibility (pub.dev WASM-ready). No behavior change on any platform.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.Performance: when getFaceEmbedding follows detectFacesFromBytes on the same encoded image, the detection isolate now reuses the already-decoded image
getFaceEmbedding follows detectFacesFromBytes on 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.Add optional LiteRT Next CompiledModel inference via CompiledModel.fromBufferWithGpuFallback (GPU with automatic CPU fallback); enable with useCompile
CompiledModel inference via CompiledModel.fromBufferWithGpuFallback (GPU with automatic CPU fallback); enable with useCompiledModel: true. The default engine remains the Interpreter, so existing code is unchanged.CameraFrameDecodePlan helper.* Update flutter_litert -> 2.8.3
raw pixels in detectFacesFromMatBytes); detectFaces is kept as a deprecated alias and will be removed in a future release
detectFaces -> detectFacesFromBytes for clarity (input is encoded image bytes, vs. raw pixels in detectFacesFromMatBytes); detectFaces is kept as a deprecated alias and will be removed in a future releaseRemove unused Darwin podspecs for Dart-only iOS/macOS plugin registration.
Migrate macOS to Swift Package Manager (CocoaPods no longer required)
* Update flutter_litert -> 2.5.5
Update flutter_litert to 2.5.3 and camera_desktop to 1.1.4
Add video file processing mode to example
* Update flutter_litert -> 2.5.0
* Update flutter_litert -> 2.4.1
Simplify and DRY example app, extract utility helpers
* Update documentation
* Update flutter_litert to 2.4.0
Re-export packYuv420, YuvPlane, YuvLayout, and PackedYuv from flutter_litert so live-camera consumers can reach the helper through the face_detection_
packYuv420, YuvPlane, YuvLayout, and PackedYuv from flutter_litert so live-camera consumers can reach the helper through the face_detection_tflite barrel without a direct flutter_litert import.flutter_litert to ^2.2.0FaceDetector.modelVersion constant 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.packYuv420 so every snippet is a real compilable example (no ghost convertCameraImageToMat, no duplicate segmenter variable, no cv.Mat type annotations requiring an unlisted import).Remove irisOkCount and irisFailCount (were deprecated in 5.1.0)
FaceDetectorIsolate - FaceDetector is now the single unified class running all inference in a background isolateirisOkCount and irisFailCount (were deprecated in 5.1.0)FaceDetector() constructor is now public; initialize() replaces the old spawn() factoryinitialize() gains withSegmentation and segmentationConfig parametersinitializeSegmentation() no longer requires re-spawning the detection isolategetFaceEmbeddingFromMatBytes to mirror detectFacesFromMatBytes for callers with pre-decoded pixel datagetFaceEmbeddingFromMat performance by transferring raw pixel bytes to the background isolate instead of re-encodingUpdate flutter_litert to 2.0.13
Update flutter_litert -> 2.0.12
Update detectFacesFromMatBytes documentation
detectFacesFromMatBytes documentationAdd detectFacesFromMatBytes to FaceDetector: detects faces from raw pixel data without constructing a cv.Mat on the calling thread (zero-copy transfer
detectFacesFromMatBytes to FaceDetector: detects faces from raw pixel data without constructing a cv.Mat on the calling thread (zero-copy transfer via TransferableTypedData)Deprecate FaceDetectorIsolate: use FaceDetector instead
FaceDetector now runs all inference in a background isolate automatically, matching FaceDetectorIsolate performancedispose() is now Future<void> (was void), existing code compiles but should be awaitedFaceDetectorIsolate: use FaceDetector insteadirisOkCount and irisFailCount (not trackable across isolate boundaries)detectFacesWithSegmentation and detectFacesWithSegmentationFromMat to FaceDetectorUpdate flutter_litert 2.0.10 -> 2.0.11
* Update documentation
Update flutter_litert 2.0.8 -> 2.0.10
Add Windows XNNPack delegate support (2-5x inference speedup)
Update flutter_litert 2.0.5 -> 2.0.6
Fix Xcode build warnings by declaring PrivacyInfo.xcprivacy as a resource bundle in iOS and macOS podspecs
Update camera_desktop 1.0.1 -> 1.0.3
camera_desktop 1.0.1 -> 1.0.3Point and BoundingBox from flutter_litert 2.0.0IsolateWorkerBase from flutter_litert_buildPersonMask and _irisCenterFromPointsFaceDetector and FaceDetectorIsolate internalsRefactor to use flutter_litert shared utilities (InterpreterFactory, PerformanceConfig, generateAnchors)
flutter_litert -> 1.2.0flutter_litert shared utilities (InterpreterFactory, PerformanceConfig, generateAnchors)Update opencv_dart 2.1.0 -> 2.2.1
opencv_dart 2.1.0 -> 2.2.1flutter_litert 1.0.2 -> 1.0.3Update flutter_litert 1.0.1 -> 1.0.2
flutter_litert 1.0.1 -> 1.0.2Update flutter_litert 0.2.2 -> 1.0.1
camera 0.11.3 -> 0.12.0flutter_litert 0.2.2 -> 1.0.1Add original model cards for archival and documentation
flutter_litert to 0.2.2Migrate iOS CocoaPods -> Swift Package Manager
Remove all deprecated image package-based APIs across FaceDetector, FaceDetectorIsolate, IsolateWorker, model runners (FaceDetectionModel, FaceLandmar…
Breaking changes:
image package-based APIs across FaceDetector, FaceDetectorIsolate, IsolateWorker, model runners (FaceDetectionModel, FaceLandmark, FaceEmbedding, IrisLandmark, SelfieSegmentation), and helper functionsimage package dependencyUpdate flutter_litert to 0.1.12
Windows: remove bundled .dll files, as they are no longer needed as of flutter_litert 0.1.4
flutter_litert 0.1.4Windows: Custom ops (segmentation) fix
Migrate from tflite_flutter_custom to flutter_litert
tflite_flutter_custom to flutter_litertFix FaceDetectorIsolate hang on Android during batch face embeddings
Fix Android build: bump tflite_flutter_custom to 1.2.5 (fixes undefined symbol TfLiteIntArrayCreate linker error)
Fix bug causing auto-bundling to fail on MacOS
Update all dependencies to latest version(s)
Selfie segmentation for background removal and virtual backgrounds
Performance optimizations: pre-allocated inference buffers, early score filtering (~17× fewer box decodes), parallel multi-face processing
Fixes #3: bug causing crash on non-XNNPack compatible Android devices
Face recognition via embeddings, enables comparing faces across images
getFaceEmbedding() / getFaceEmbeddings() methods on FaceDetector and FaceDetectorIsolatecompareFaces() for cosine similarity, faceDistance() for Euclidean distance- Fix crash on Windows platforms
Add FaceDetectorIsolate for background thread detection
Native image processing with opencv_dart for ~2x performance improvement via SIMD acceleration
detectFaces() now uses OpenCV internallydetectFacesFromMat() method for camera streams (avoids repeated encode/decode overhead)PerformanceConfig.disabled to opt out)Your coding agent can read these notes before it upgrades. Set up the MCP server →