FaceDetection class

Runs face box detection and predicts a small set of facial keypoints (eyes, nose, mouth, tragions) on the detected face(s).

The underlying TFLite models are sourced from Google's MediaPipe framework (BlazeFace). See the official model cards for architecture details, training data, and intended use cases:

Properties

hashCode int
The hash code for this object.
no setterinherited
inputHeight int
The model input height in pixels.
no setter
inputWidth int
The model input width in pixels.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

callWithTensor(ImageTensor pack) Future<List<Detection>>
Runs face detection on a pre-computed tensor.
dispose() → void
Releases all TensorFlow Lite resources held by this model.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create(FaceDetectionModel model, {InterpreterOptions? options, PerformanceConfig? performanceConfig}) Future<FaceDetection>
Creates and initializes a face detection model instance.
createCompiledFromBuffer(Uint8List modelBytes, FaceDetectionModel model, {Set<Accelerator> accelerators = const {Accelerator.gpu, Accelerator.cpu}, Precision precision = Precision.fp16}) Future<FaceDetection>
Creates a face detection model backed by LiteRT CompiledModel.
createFromBuffer(Uint8List modelBytes, FaceDetectionModel model, {PerformanceConfig? performanceConfig}) Future<FaceDetection>
Creates a face detection model from pre-loaded model bytes.