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). |
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