FaceBlendshapesModel class
Runs the MediaPipe Blendshape V2 model, which classifies a packed set of 146 facial landmarks into 52 expression coefficients (blendshapes).
Unlike the other models in this package, this is not an image model: it
never sees pixels. Its input is a [1, 146, 2] tensor of landmark
coordinates produced by packBlendshapeInput, and its output is 52
coefficients in [0, 1] (a terminal sigmoid keeps them in range). Because
the input is tiny and dense, the model runs in well under a millisecond on
CPU, so it is pinned to the CPU on every path (no GPU dispatch payoff).
The underlying TFLite model (face_blendshapes.tflite, MLP-Mixer, float16)
is extracted from Google's MediaPipe Face Landmarker task bundle. See the
official model card for architecture, training data, and intended use:
https://storage.googleapis.com/mediapipe-assets/Model%20Card%20Blendshape%20V2.pdf
(local copy: doc/model_cards/blendshape_v2_model_card.pdf)
Used internally by FaceDetector in FaceDetectionMode.full; results are exposed via Face.blendshapes, Face.smilingProbability, and the eye-open probability getters.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call(
Float32List packed) → Future< Float32List?> -
Runs the model on a packed
[1, 146, 2]landmark tensor and returns the 52 blendshape coefficients, each clamped to[0, 1]. -
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(
{InterpreterOptions? options}) → Future< FaceBlendshapesModel> - Creates and initializes the model from package assets.
-
createCompiledFromBuffer(
Uint8List modelBytes) → Future< FaceBlendshapesModel> -
Creates the model backed by a LiteRT
CompiledModel, pinned to the CPU. -
createFromBuffer(
Uint8List modelBytes, {InterpreterOptions? options}) → Future< FaceBlendshapesModel> - Creates the model from pre-loaded model bytes.
-
createFromFile(
String modelPath, {InterpreterOptions? options}) → Future< FaceBlendshapesModel> -
Creates the model from a custom
.tflitefile on disk.