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:
Returns:
  • tfsdk.ERRORCODE - The error code.

  • tfsdk.MASKLABEL - The predicted tfsdk.MASKLABEL for the input face.

  • float - The mask score for these images. This can be used for setting custom thresholds that work better for the use case. By default, we use a mask score greater than 0.82 to determine that no mask was detected.

SDK.detect_masks(self: tfsdk.SDK, tf_facechips: 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:

tf_facechips A list of tfsdk.TFFacechip on which to run mask detection.

Returns:
  • tfsdk.ERRORCODE - The error code.

  • List[tfsdk.MASKLABEL] - The predicted tfsdk.MASKLABEL for the input face chips.

  • List[float] - The mask scores for these images. This can be used for setting custom thresholds that work better for the use case. By default, we use a mask score greater than 0.82 to determine that no mask was detected.

class tfsdk.MASKLABEL

Members:

MASK : There is a mask on the face.

NO_MASK : There is no mask on the face.