Mask Detection¶
- SDK.detect_mask(self: tfsdk.SDK, tf_image: tfsdk.TFImage, 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
tf_image – the input
tfsdk.TFImage, returned bytfsdk.SDK.preprocess_image().face_box_and_landmarks –
tfsdk.FaceBoxAndLandmarksreturned bytfsdk.SDK.detect_faces()ortfsdk.SDK.detect_largest_face().
- Returns
The
ERRORCODE, thetfsdk.MASKLABELand a float indicating the probability that no mask is detected.
- SDK.detect_masks(self: tfsdk.SDK, chips: List[tfsdk.TFFacechip]) → Tuple[tfsdk.ERRORCODE, List[tfsdk.MASKLABEL], List[float]]¶
Detect whether the faces are wearing a mask or not. This batch processing method increases throughput when using GPU inference.
- Parameters
chips – A list of
tfsdk.TFFacechipon which to run mask detection.- Returns
The
ERRORCODE, list oftfsdk.MASKLABEL, and a list of floats indicating the probability that no mask is detected.
- class tfsdk.MASKLABEL¶
Members:
MASK : There is a mask on the face.
NO_MASK : There is no mask on the face.