Package-level declarations

Types

Link copied to clipboard
class ArcFaceEmbedder(engine: InferenceEngine, model: ByteArray, options: SessionOptions = SessionOptions()) : FaceEmbedder

ArcFace-family embedder (e.g. MobileFaceNet trained with ArcFace loss). Model I/O contract: [1,3,112,112] RGB normalised to (v - 127.5) / 127.5, output a single embedding vector (typically 512-d).

Link copied to clipboard
data class Face(val box: Rect, val landmarks: FaceLandmarks, val score: Double)

A detected face. Coordinates are in the pixel space of the image passed to the detector.

Link copied to clipboard
data class FaceAnalysis(val faces: List<Face>, val face: Face?, val quality: FaceQualityReport?, val liveness: LivenessResult?, val issues: List<FaceIssue>)
Link copied to clipboard
class FaceAnalyzer(detector: FaceDetector, quality: FaceQualityAssessor = FaceQualityAssessor(), liveness: LivenessDetector? = null) : AutoCloseable

Selfie pipeline: detect -> quality gate -> optional liveness. Cheap detector runs on every frame; the heavier liveness model only runs on frames that already pass quality checks.

Link copied to clipboard

Finds faces in an image. Implementations must return results sorted by descending Face.score.

Link copied to clipboard

Turns an aligned face into a FaceEmbedding.

Link copied to clipboard
class FaceEmbedding(values: FloatArray)

An L2-normalised face descriptor. Compare with FaceMatcher; never persist raw images just to re-embed.

Link copied to clipboard
Link copied to clipboard
data class FaceLandmarks(val rightEye: Point, val leftEye: Point, val nose: Point, val rightMouth: Point, val leftMouth: Point)

The five facial landmarks produced by the detector.

Link copied to clipboard
class FaceMatcher(val threshold: Double = 0.3)

Decides whether two embeddings show the same person.

Link copied to clipboard
data class FaceMatchResult(val similarity: Double, val isMatch: Boolean)
Link copied to clipboard
class FaceQualityAssessor(config: FaceQualityConfig = FaceQualityConfig())

Cheap, model-free checks that decide whether a face crop is good enough for liveness or matching.

Link copied to clipboard
data class FaceQualityConfig(val minFaceWidthRatio: Double = 0.2, val minBlurScore: Double = 30.0, val minBrightness: Double = 60.0, val maxBrightness: Double = 200.0, val maxYaw: Double = 25.0, val maxPitch: Double = 25.0, val maxRoll: Double = 25.0)

Thresholds for FaceQualityAssessor. Defaults are conservative starting points; calibrate them on your target cameras before relying on them.

Link copied to clipboard
data class FaceQualityReport(val face: Face, val blurScore: Double, val brightness: Double, val pose: HeadPose, val issues: List<FaceIssue>)
Link copied to clipboard
data class HeadPose(val yaw: Double, val pitch: Double, val roll: Double)

Approximate head orientation in degrees. Positive yaw = nose displaced towards the right of the image, positive pitch = looking up, positive roll = head tilted clockwise on screen.

Link copied to clipboard

Decides whether a detected face is a live person or a presentation attack (printed photo, screen replay).

Link copied to clipboard
data class LivenessResult(val realScore: Double, val isLive: Boolean)
Link copied to clipboard
class MiniFasNetLivenessDetector(engine: InferenceEngine, model: ByteArray, cropScale: Double = 2.7, threshold: Double = 0.5, options: SessionOptions = SessionOptions()) : LivenessDetector

Passive single-frame liveness using MiniFASNet (Apache-2.0). Model I/O contract: [1,3,80,80] BGR 0..255 in, 3 logits out where class 1 is "real".

Link copied to clipboard
class YuNetFaceDetector(engine: InferenceEngine, model: ByteArray, config: YuNetFaceDetector.Config = Config(), options: SessionOptions = SessionOptions()) : FaceDetector

Face detector backed by YuNet (face_detection_yunet_2023mar.onnx, MIT). Model I/O contract: input float32 [1,3,640,640] BGR 0..255; outputs cls|obj|bbox|kps for strides 8, 16 and 32.

Functions

Link copied to clipboard

Estimates HeadPose from the landmarks of this face.