Skip to content

Face occlusion estimation#

The face occlusion estimation determines whether the lower part of the face in a frame is covered by an object.

Behavior in different platforms#

In LUNA ID for Android#

Default behavior#

You can enable or disable via the LunaConfig.acceptOccludedFaces parameter. By default, this parameter is set to true, meaning that no estimations for occluded faces are performed.

val config = LunaConfig.create(
                ...
                acceptOccludedFaces = true
                ...
            )

Choosing the right estimator#

  • Use faceOcclusionEstimatorEnabled = true for general face occlusion estimations, such as detecting hands or objects covering the face.
  • Use faceOcclusionEstimatorEnabled = false for specific checks like medical masks or mouth occlusions.
val config = LunaConfig.create(
                ...
                acceptOccludedFaces = false,
                faceOcclusionEstimatorEnabled =true
                ...
            )

In LUNA ID for iOS#

The face occlusion estimation checks if the lower part of the face and the mouth in a frame are occluded by an object. However, you can still perform the mouth and medical mask estimations separately.

The faceOcclusionEstimatorEnabled parameter controls whether the system should check one face for an occlusion. 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.

Dependency on mouth estimation#

The face occlusion estimation is performed after the mouth estimation if both the estimations are enabled.

Error handling#

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

Implementation#

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