Mask Detection

SDK.detect_mask(self: tfsdk.SDK, face_box_and_landmarks: tfsdk.FaceBoxAndLandmarks) → Tuple[tfsdk.ERRORCODE, tfsdk.MASKLABEL, float]

Detect if there is a mask on the face in the given image.

Parameters

face_box_and_landmarkstfsdk.FaceBoxAndLandmarks returned by tfsdk.SDK.detect_faces() or tfsdk.SDK.detect_largest_face().

Returns

The ERRORCODE, the tfsdk.MASKLABEL, and the mask score, in that order. The mask score can be used for setting a custom threshold that works better for the use case. By default, we use a mask score greater than 3.0 to determine that a mask was detected.

class tfsdk.MASKLABEL

Members:

MASK : There is a mask on the face

NO_MASK : There is no mask on the face