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:
- Front camera / short range: https://mediapipe.page.link/blazeface-mc
(local copy:
doc/model_cards/blazeface_short_range_model_card.pdf) - Back camera / full range: https://mediapipe.page.link/blazeface-back-mc
(local copy:
doc/model_cards/blazeface_full_range_model_card.pdf) - Full range sparse: https://mediapipe.page.link/blazeface-back-sparse-mc
(local copy:
doc/model_cards/blazeface_full_range_sparse_model_card.pdf)
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.