.. index:: 
  !FaceAnalyser.detectOcclusions Method
  
.. _id3_face_face_analyser_detect_occlusions_class_method:

===============================================================================
FaceAnalyser.detectOcclusions Method
===============================================================================

Module: :ref:`FaceAnalyser<id3_face_face_analyser_class>`

Definition
----------

Detects occlusions on the subject's face.

.. important:: This function requires the ``FaceOcclusionDetector`` model to be loaded.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        detect_occlusions(self, image: Image, detected_face: DetectedFace) -> FaceOcclusionScores

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detected_face`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`FaceOcclusionScores<id3_face_face_occlusion_scores_struct>`
          The occlusion scores of the detected face.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        FaceOcclusionScores detectOcclusions(Image image, DetectedFace detectedFace)

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`FaceOcclusionScores<id3_face_face_occlusion_scores_struct>`
          The occlusion scores of the detected face.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public FaceOcclusionScores DetectOcclusions(Image image, DetectedFace detectedFace)

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`FaceOcclusionScores<id3_face_face_occlusion_scores_struct>`
          The occlusion scores of the detected face.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public FaceOcclusionScores detectOcclusions(Image image, DetectedFace detectedFace) throws FaceException

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`FaceOcclusionScores<id3_face_face_occlusion_scores_struct>`
          The occlusion scores of the detected face.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public func detectOcclusions(image: Image, detectedFace: DetectedFace) throws -> FaceOcclusionScores

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`FaceOcclusionScores<id3_face_face_occlusion_scores_struct>`
          The occlusion scores of the detected face.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3FaceAnalyser_DetectOcclusions (
            ID3_FACE_ANALYSER hFaceAnalyser, 
            ID3_FACE_IMAGE hImage, 
            ID3_DETECTED_FACE hDetectedFace, 
            id3FaceOcclusionScores * sScores)

      **Parameters**

        .. line-block::

          ``hFaceAnalyser`` :ref:`ID3_FACE_ANALYSER<id3_face_face_analyser_class>`
          :guilabel:`in` Handle to the FaceAnalyser object.

          ``hImage`` :ref:`ID3_FACE_IMAGE<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``hDetectedFace`` :ref:`ID3_DETECTED_FACE<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.

          ``sScores`` :ref:`id3FaceOcclusionScores *<id3_face_face_occlusion_scores_struct>`
          :guilabel:`out` The occlusion scores of the detected face.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3FaceError<id3_face_face_error_enum>` file for the list of possible error codes.


