FaceReader

class FaceReader(dir: File, threads: Int) : AutoCloseable(source)

Finds the faces in a photo and gives each a fingerprint (FaceModel), in three steps:

  1. YuNet marks faces: a box, a confidence and 5 landmarks (eyes, nose tip, mouth corners).

  2. Each face is straightened onto a 112×112 template from its landmarks (the rotation, scale and shift that fit them best), the way the recognizer was trained.

  3. SFace turns it into 128 numbers; the same person's faces point the same way.

Same steps as tools/faces/face_compare.py, which checks them on the Mac.

Constructors

Link copied to clipboard
constructor(dir: File, threads: Int)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Found(val box: FloatArray, val vector: FloatArray)

A face: its box as fractions of the photo (left, top, right, bottom) and fingerprint.

Properties

Link copied to clipboard

Time spent per step, in ns, when set (Search Lab's profile); null in normal use. Keys: prepare, detect, decodeOutput, straighten, embedPrepare, embed.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
fun read(original: Bitmap): List<FaceReader.Found>