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

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

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

  • maskScore[out] 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 that a mask was detected.

Returns

error code, see ErrorCode.

enum Trueface::MaskLabel

Results from mask detection

Values:

enumerator MASK

There is a mask on the face

enumerator NO_MASK

There is no mask on the face