FaceNetFaceMatcher

class FaceNetFaceMatcher(val modelBytes: ByteString, val config: FaceNetModelConfig = FaceNetModelConfig.AUTO, val debug: Boolean = false, val name: String = if (debug) "facenet_debug" else "facenet", val displayName: String = if (debug) "MobileFaceNet (debug)" else "MobileFaceNet") : FaceMatcher

A face matcher implementation based on Google FaceNet and MobileFaceNet models.

Constructors

Link copied to clipboard
constructor(modelBytes: ByteString, config: FaceNetModelConfig = FaceNetModelConfig.AUTO, debug: Boolean = false, name: String = if (debug) "facenet_debug" else "facenet", displayName: String = if (debug) "MobileFaceNet (debug)" else "MobileFaceNet")
constructor(modelBytes: ByteString)
constructor(modelBytes: ByteString, debug: Boolean)
constructor(modelBytes: ByteString, config: FaceNetModelConfig)

Properties

Link copied to clipboard

configuration parameters specifying input dimensions, normalization, and match threshold.

Link copied to clipboard

whether debug mode is enabled. When debug mode is active, the matcher is identified as "facenet_debug", displays biometric telemetry on the camera overlay, and enables a cheat mode where tapping or pressing the camera preview area automatically matches / completes verification (useful when testing with non-matching test credentials).

Link copied to clipboard
open override val displayName: String

human-readable display name.

Link copied to clipboard

Whether native on-device face matching is supported on the current platform runtime.

Link copied to clipboard
val modelBytes: ByteString

the .tflite model data.

Link copied to clipboard
open override val name: String

unique machine identifier for this matcher.

Link copied to clipboard
open override val supportsLiveness: Boolean
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
open override fun createSession(referencePortrait: ByteString): FaceMatcherSession
Link copied to clipboard
suspend fun extractFaceCrop(portrait: ByteString): ByteString

Extracts the detected, aligned face crop image that is matched against.

Link copied to clipboard
suspend fun getFaceEmbedding(portrait: ByteString): FaceEmbedding

Computes the biometric FaceEmbedding for the detected face in portrait.

Link copied to clipboard
suspend fun getPassiveLivenessScore(portrait: ByteString): Float

Computes the passive presentation attack detection (PAD) score (bona fide probability in [0.0, 1.0]) for the detected face in portrait using the embedded MiniFASNetV2 model.

Link copied to clipboard
suspend fun matchPortraits(portraitA: ByteString, portraitB: ByteString): Float

Matches two portrait images and returns their cosine similarity.