Face Utils
DeGirum Face API Reference. Shared math, filtering, and post-processing helpers.
Last updated
Was this helpful?
DeGirum Face API Reference. Shared math, filtering, and post-processing helpers.
This API Reference is based on DeGirum Face version 1.4.1.
face_align_and_crop(img, landmarks, image_size)
Align and crop the face from the image based on the given landmarks.
Parameters:
img
ndarray
The full image (not the cropped bounding box).
required
landmarks
List[ndarray]
List of 5 keypoints (landmarks) as (x, y) coordinates in the following order: [left eye, right eye, nose, left mouth, right mouth].
required
image_size
int
The size to which the image should be resized.
required
Returns:
ndarray
np.ndarray: the aligned face image
face_is_frontal(landmarks)
Check if the face is frontal based on the landmarks.
Parameters:
landmarks
List[ndarray]
List of 5 keypoints (landmarks) as (x, y) coordinates in the following order: [left eye, right eye, nose, left mouth, right mouth].
required
Returns:
bool
bool
True if the face is frontal, False otherwise.
face_is_shifted(bbox, landmarks)
Check if the face is shifted based on the landmarks.
Parameters:
bbox
List[float]
Bounding box of the face as [x1, y1, x2, y2].
required
landmarks
List[ndarray]
List of keypoints (landmarks) as (x, y) coordinates
required
Returns:
bool
bool
True if the face is shifted to a side of bbox, False otherwise.
Last updated
Was this helpful?
Was this helpful?

