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 |
---|---|
Estimated age of the subject. |
|
Estimated color and structure uniformity of the background in a portrait image. See also Face background removal. |
|
Value indicating whether an image is colorized or grayscale. |
|
Estimated facial expressions of a subject classified in six universal emotions: angriness, disgust, fear, happiness, sadness, surprise, and additionally neutral. |
|
Estimated gaze direction for both eyes. When the subject looks directly towards the camera, the return values equal 0. |
|
Degree of opening of both eyes. The resulting scores are in the range 0 to 100. |
|
Group of additional attributes, including:
|
|
Presence of a protective mask on the subject face. |
|
Set of geometric characteristics of a portrait image.
|
|
Additional set of attributes related to glasses (if present). It includes:
|
|
Estimation of the head pose. Yaw, pitch and roll angles are returned in degrees. |
|
Estimated 68 landmark features |
|
Quantity of noise in the image. |
|
Presence of occlusions on the subject’s face (eyes, nose, mouth). |
|
Photographic quality attributes such as brigthness, dynamic range, flash reflection, natural skin color, exposure, pixelation, sharpness. |
|
Detect if a person’s eyes are red or not (due to flash mostly). |
AI models¶
The face analyser requires machine learning models to be loaded into memory.
Model Name |
Description |
---|---|
EyeGazeEstimator2A |
Estimates the direction of gaze. |
EyeOpennessDetector1A |
Detects the degree of eye opening. |
EyeRednessDetector1A |
Detects red-eye. |
FaceAgeEstimator1A |
Estimates the subject’s age. |
FaceAttributesClassifier2A |
Detects facial attributes such as glasses, hat, make-up, mouth opening, smile and gender of the subject. |
FaceBackgroundUniformityEstimator1A |
Estimates color and structure uniformity of the background. |
FaceExpressionClassifier1A |
Face expression classifier. |
FaceLandmarksEstimator2A |
Extracts 68 landmark features. |
FaceMaskClassifier2A |
Detects the presence of a protective mask on a subject’s face. |
FaceOcclusionDetector2A |
Detects occlusions on the subject’s face (eyes, nose, mouth) |
FacePoseEstimator1A |
Estimates the pose of the face (yaw pitch, roll). |
Parameters¶
Parameter |
Description |
---|---|
The sensibility of the expression classifier. |
|
Sensibility of the over-exposure classifier. |
|
Sensibility of the under-exposure classifier. |
|
Number of threads to be used for face analysis. |
Example¶
# 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