LocalFaceVerificationProvider class
On-device face verification using ML Kit face contours.
Extracts normalized contour features from detected faces and compares them against enrolled templates using cosine similarity.
final provider = LocalFaceVerificationProvider();
// Enroll (collect faces via onFaceSnapshot callback first)
final template = await provider.enroll('Owner', collectedFaces);
// Verify
final result = await provider.verify(detectedFace);
print(result.isMatch); // true if face matches an enrolled template
- Implemented types
Constructors
- LocalFaceVerificationProvider({FaceTemplateStore? store, double minMatchScore = 0.6, bool enableLiveness = true, LivenessChecker? livenessChecker})
Properties
- enableLiveness → bool
-
Whether to run liveness checks during verification.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- minMatchScore → double
-
Minimum cosine similarity score (0.0–1.0) to consider a match.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- store → FaceTemplateStore
-
Template storage backend. Defaults to InMemoryTemplateStore.
final
Methods
-
checkLiveness(
Face face) → Future< LivenessResult> -
Check a face for liveness (anti-spoofing).
override
-
clearAll(
) → Future< void> -
Delete all enrolled templates.
override
-
deleteTemplate(
String id) → Future< void> -
Delete an enrolled template by ID.
override
-
enroll(
String label, List< Face> samples) → Future<FaceTemplate> -
Enroll a new face from multiple sample captures.
override
-
listTemplates(
) → Future< List< FaceTemplate> > -
List all enrolled templates.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
verify(
Face face) → Future< FaceVerificationResult> -
Verify a detected face against enrolled templates.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited