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

# Face analysis

id3 Face SDK can analyse a wide range of facial attributes. For instance, it can evaluate the compliancy of a portrait to the ISO/IEC 19794-5 full frontal and the ICAO Portrait Quality Standards thanks to the following modules:

Attribute | Description
--- | ---
Age | Estimated age of the subject.
Background uniformity | Estimated color and structure uniformity of the background in a portrait image. See also Face background removal.
Colorized image | Value indicating whether an image is colorized or grayscale.
Expression | Estimated facial expressions of a subject classified in six universal emotions: angriness, disgust, fear, happiness, sadness, surprise, and additionally neutral.
Eye gaze | Estimated gaze direction for both eyes. When the subject looks directly towards the camera, the return values equal 0.
Eye opening | Degree of opening of both eyes. The resulting scores are in the range 0 to 100.
Face attributes | Group of additional attributes, including:

- Glasses

- Hat

- Make-up

- Male (gender estimation)

- Mouth opening

- Smile

Face mask | Presence of a protective mask on the subject face.
Geometric attributes | Set of geometric characteristics of a portrait image.

- Resolution: Checks if the image resolution is sufficient.

- Vertical position: Checks the distance from the bottom edge of the image to the imaginary line passing through the center of the eyes is between 50% - 70% of the total vertical length of the image.

- Horizontal position: Checks if the head is correctly centered horizontally.

- Width of head: Checks if the image width is conform to the (image width / head width) ratio of 7:5. The head width is defined as the distance between the left and right ears.

- Length of head: Checks if the distance between the base of the chin and the crown is less than 80% of the total height of the image.

Glasses attributes | Additional set of attributes related to glasses (if present). It includes:

- Frame on eye

- Heavy frame

- Tinted glasses

Head pose | Estimation of the head pose. Yaw, pitch and roll angles are returned in degrees.
Landmarks | Estimated 68 landmark features
Noise | Quantity of noise in the image.
Occlusions | Presence of occlusions on the subject’s face (eyes, nose, mouth).
Photographic attributes | Photographic quality attributes such as brigthness, dynamic range, flash reflection, natural skin color, exposure, pixelation, sharpness.
Red eyes | Detect if a person’s eyes are red or not (due to flash mostly).

## Parameters

Parameter | Description
--- | ---
Expression sensibility | The sensibility of the expression classifier.
Over-exposure sensibility | Sensibility of the over-exposure classifier.
Under-exposure sensibility | Sensibility of the under-exposure classifier.
Thread count | Number of threads to be used for face analysis.

## Example

Python

    # initialize the FaceAnalyser module
    face_analyser = FaceAnalyser(
        thread_count = 4
    )

    # compute age
    age = face_analyser.compute_age(image, face)
    print(f"Age: {age}")

    # compute landmarks
    landmarks = face_analyser.compute_landmarks(image, face)

    # compute eye-gaze
    eye_gaze = face_analyser.compute_eye_gaze(image, face, landmarks)

    # Release all resources allocated to the FaceAnalyser module.
    del face_analyser

## See also

- FaceAnalyser Class