Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# FacePad.computeDepthBasedScore Method

Module: FacePad

## Definition

Computes the PAD score of a detected face using a depth map image.

A high score means a high probability for the face to be bona-fide, hence not an attack.

The minimum recommended value is 10.

Important

Loading the `FaceDepthBasedPad` model is required to use this function.

Python

    compute_depth_based_score(self, image: Image, detected_face: DetectedFace) -> int

Parameters

> `image` Image
> in Source image to process. Must be Grayscale 16 Bits.
> `detected_face` DetectedFace
> in Detected face to process.

Returns

> `int`
> The computed PAD score, in the range [0;100].

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Dart

    int computeDepthBasedScore(Image image, DetectedFace detectedFace)

Parameters

> `image` Image
> in Source image to process. Must be Grayscale 16 Bits.
> `detectedFace` DetectedFace
> in Detected face to process.

Returns

> `int`
> The computed PAD score, in the range [0;100].

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C#

    public int ComputeDepthBasedScore(Image image, DetectedFace detectedFace)

Parameters

> `image` Image
> in Source image to process. Must be Grayscale 16 Bits.
> `detectedFace` DetectedFace
> in Detected face to process.

Returns

> `int`
> The computed PAD score, in the range [0;100].

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Java

    public int computeDepthBasedScore(Image image, DetectedFace detectedFace) throws FaceException

Parameters

> `image` Image
> in Source image to process. Must be Grayscale 16 Bits.
> `detectedFace` DetectedFace
> in Detected face to process.

Returns

> `int`
> The computed PAD score, in the range [0;100].

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Swift

    public func computeDepthBasedScore(image: Image, detectedFace: DetectedFace) throws -> Int32

Parameters

> `image` Image
> in Source image to process. Must be Grayscale 16 Bits.
> `detectedFace` DetectedFace
> in Detected face to process.

Returns

> `Int`
> The computed PAD score, in the range [0;100].

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C

    int id3FacePad_ComputeDepthBasedScore (
        ID3_FACE_PAD hFacePad,
        ID3_FACE_IMAGE hImage,
        ID3_DETECTED_FACE hDetectedFace,
        int * score)

Parameters

> `hFacePad` ID3_FACE_PAD
> in Handle to the FacePad object.
> `hImage` ID3_FACE_IMAGE
> in Source image to process. Must be Grayscale 16 Bits.
> `hDetectedFace` ID3_DETECTED_FACE
> in Detected face to process.
> `score` int *
> out The computed PAD score, in the range [0;100].

Returns

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