Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class BlazeFaceAnchor(val xCenter: Float, val yCenter: Float, val w: Float, val h: Float)

2D anchor box for SSD detection.

Link copied to clipboard

Pure Kotlin decoder for Google MediaPipe BlazeFace detection tensors.

Link copied to clipboard
data class BlazeFaceDetection(val score: Float, val boundingBox: FaceBoundingBox, val rightEye: FacePoint2D, val leftEye: FacePoint2D, val noseTip: FacePoint2D, val mouthCenter: FacePoint2D, val rightEarTragus: FacePoint2D, val leftEarTragus: FacePoint2D, val yaw: Float, val pitch: Float, val roll: Float, val imageWidth: Int = 0, val imageHeight: Int = 0) : DetectedFacePose

Detection result from BlazeFace detector containing bounding box, 6 facial landmarks, confidence score, and estimated head pose.

Link copied to clipboard

Embedded binary data for Google MediaPipe BlazeFace short-range face detection model (face_detection_short_range.tflite, Apache-2.0 license).

Link copied to clipboard

Head pose directions requested during active liveness challenges.

Link copied to clipboard

Common pose interface for detected faces across platforms.

Link copied to clipboard
data class FaceBoundingBox(val left: Double, val top: Double, val width: Double, val height: Double)

2D bounding box representation for detected faces.

Link copied to clipboard
data class FaceEmbedding(val embedding: FloatArray)

Normalized multidimensional face embeddings vector.

Link copied to clipboard
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.

Link copied to clipboard
abstract class FaceNetLivenessSessionBase<TFace : DetectedFacePose>(val config: FaceNetModelConfig, poses: List<FacePose> = listOf(FacePose.FRONT), val debug: Boolean = false, val matcherName: String = "facenet", val matcherDisplayName: String = "MobileFaceNet", val clock: () -> Long = { Clock.System.now().toEpochMilliseconds() }, randomSeed: Long = clock(), val enablePoseSmoothing: Boolean = true) : FaceMatcherLivenessSession

Base class containing the shared liveness verification and sequential pose capture state machine for FaceNet.

Link copied to clipboard
data class FaceNetModelConfig(val imageSquareSize: Int? = null, val embeddingDim: Int? = null, val normalization: NormalizationMethod = NormalizationMethod.SCALE_ZERO_TO_ONE, val matchThreshold: Float = 0.63f, val passiveLivenessThreshold: Float = 0.5f)

Configuration parameters for FaceNet and MobileFaceNet models.

Link copied to clipboard
abstract class FaceNetSessionBase<TFace : DetectedFacePose>(referencePortrait: ByteString, val config: FaceNetModelConfig, val debug: Boolean = false, val matcherName: String = "facenet", val matcherDisplayName: String = "MobileFaceNet", val clock: () -> Long = { Clock.System.now().toEpochMilliseconds() }, randomSeed: Long = clock(), val enablePoseSmoothing: Boolean = true) : FaceMatcherSession

Base class containing the shared biometric verification state machine for FaceNet.

Link copied to clipboard
data class FacePoint2D(val x: Double, val y: Double)

2D point representation for facial landmarks.

Link copied to clipboard
class HeadPoseFilter(minCutoff: Double = 1.0, beta: Double = 0.007, dCutoff: Double = 1.0)

Filter that smoothes 3D head pose angles (yaw, pitch, roll) over time using OneEuroFilter.

Link copied to clipboard
Link copied to clipboard

Embedded binary data for MiniFASNetV2 passive face anti-spoofing model (2.7_80x80_MiniFASNetV2 from Silent-Face-Anti-Spoofing, Apache-2.0 license, converted to FP16 TFLite with RGB 0, 255 input and 3-class softmax output).

Link copied to clipboard

Preprocessing normalization method for face image tensors.

Link copied to clipboard
class OneEuroFilter(val minCutoff: Double = 1.0, val beta: Double = 0.007, val dCutoff: Double = 1.0)

1€ (One-Euro) Filter for real-time signal smoothing with adaptive cutoff frequency.

Link copied to clipboard
data class RingSegment(val color: Int, val scale: Float = 1.0f)

Visual feedback segment in the biometric verification prompt overlay.

Link copied to clipboard
data class SimilarityTransform2D(val a: Double, val b: Double, val tx: Double, val ty: Double)

2D similarity transform (uniform scale, rotation, and translation) mapping source image coordinates (x, y) to aligned target crop coordinates (x', y'):

Functions

Link copied to clipboard
fun computeAntiSpoofCropBox(boundingBox: FaceBoundingBox, imageWidth: Int, imageHeight: Int, scale: Double = 2.7): FaceBoundingBox

Computes the expanded, image-clamped bounding box for passive face anti-spoofing (MiniFASNetV2).

Link copied to clipboard
fun computeFaceAlignmentTransform(rightEye: FacePoint2D, leftEye: FacePoint2D, noseTip: FacePoint2D, mouthCenter: FacePoint2D, targetSize: Int): SimilarityTransform2D?

Computes the optimal 2D similarity transform (Umeyama / Procrustes least-squares alignment) from the 4 central BlazeFace landmarks (rightEye, leftEye, noseTip, mouthCenter) to a canonical square target face template of size targetSize x targetSize.