Mask Detection

ErrorCode Trueface::SDK::detectMask(const FaceBoxAndLandmarks &faceBoxAndLandmarks, MaskLabel &result, float &maskScore)

Detect whether the face in the image is wearing a mask or not


error code, see ErrorCode.

  • [in] faceBoxAndLandmarks: FaceBoxAndLandmarks returned by detectFaces() or detectLargestFace().

  • [out] result: The predicted result for face image.

  • [out] maskScore: The mask score for this image. This can be used for setting custom thresholds that work better for the use case. By default, we use a mask score greater than 3.0 to determine if a mask was detected.

enum Trueface::MaskLabel

Results from mask detection


enumerator MASK

There is a mask on the face

enumerator NO_MASK

There is no mask on the face