Face detector¶
To detect faces on an image the IDLive Face uses custom face detector. This detector is used when an image is submitted for analysis to ensure that not only a face is detected but also that the image is of sufficient quality for analysis (e.g., no cropped or big enough).
This detector can be used directly with the FaceDetector class:
idliveface::FaceDetector detector = blueprint->CreateFaceDetector();
idliveface::FacetectionResult result = face_detector->DetectFaces(image);
std::cout << "Face detection result: " << result << std::endl;
detector = blueprint.create_face_detector()
result = detector.detect_faces(image)
print(f"result: {result}")
detector = blueprint.createFaceDetector();
FaceDetectionResult result = detector.detectFaces(image);
System.out.println("Result: " + result);
The result of the face detection contains the following:
- faces is a vector of all the detected faces. For each of one the following information is returned:
- A set of attributes of the face. See below for more details
- A list of validations that failed, if any. See below for more details
- image quality attributes Attributes of the analysed image, currently only holds
underexposurewhich reflects how dark or light is the image. From 0 (normal) to 1 (too dark) - failed_validations Contains global failed validations and ones from all the faces.
The validations that can fail when detecting and image are the following
kFaceNotFoundNo faces are found on the image.kTooManyFacesThere is more than one face on the image.kSmallFaceSizeThe face box is too small.kSmallRelativeFaceSizeThe face relative size is too small.kSmallPupillaryDistanceThe distance between pupils on the face is too small.kLargeFaceRotationAngleThe rotation angle of the head (inc. roll, pitch an yaw) is too big.kFaceTooCloseThe face is too close to the camera.kFaceCloseToBorderThe face is too close to one or more image borders.kFaceCroppedThe face is cropped.kFaceOccludedThe face is occluded, currently only detects medical mask.kEyesClosedThe eyes are closed.kDarkImageThe image is too dark.
For each detected image a set of attributes are returned:
boxis a bounding box that encapsulates the imagelandmarkslist the positions of different landmark points of the facehead_poseThe roll, pitch and yaw rotation angles of the headorientationIt's a roll angle rounded to a nearest multiply of 90. Can be -90, 0, 90 or 180.pupillary_distanceThe distance between the centers of pupils, in pixels.occlusionThe probability that the face is occluded (for example with medical mask), from 0 (not occluded) to 1 (occluded).eyes_closedThe probability that the eyes are closed, from 0 (open) to 1 (closed).