Skip to content

Medical mask estimation#

The medical mask estimation recognizes full or partial face coverage by a medical mask. This feature allows you to define whether such frames can still be considered as best shots. For details, see Getting the best shot with an occluded face.

Dependency on mouth estimation#

The medical mask estimation is performed before the mouth estimation. If the medical mask estimation fails (that is, a mask is detected), the mouth estimation will not be conducted.

Dependency on face occlusion estimation#

  • LUNA ID for Android: Set the acceptOccludedFaces and faceOcclusionEstimatorEnabled to false for medical mask estimation.
  • LUNA ID for iOS: Face occlusion and medical mask estimations are performed independently. If both face occlusion and medical mask estimations are enabled, the mask estimator runs first. When a medical mask is detected, the face occlusion estimation is omitted.

For details, see Face occlusion estimation.

Error handling#

  • LUNA ID for Android: Returns the OccludedFace error message.
  • LUNA ID for iOS: Returns error code 1010.

Implementation#

Platform Implementation
LUNA ID for Android public val acceptOccludedFaces: Boolean = true
LUNA ID for iOS @property (nonatomic, assign) BOOL occludeCheck;

Additional notes#

  • LUNA ID for Android: By default, acceptOccludedFaces is set to true, allowing frames with occluded faces to be considered as potential best shots. Adjust this setting based on your specific requirements.
  • LUNA ID for iOS: The occludeCheck parameter toggles the medical mask estimation. Setting it to false disables this estimation, while setting it to true enables it. Ensure that you adjust this parameter according to your application's needs.