| get_key_landmarks | R Documentation |
Extracts the 5 key facial landmarks commonly used for face alignment: left eye, right eye, nose tip, left mouth corner, right mouth corner.
get_key_landmarks(img_path, detector = "retinaface")
img_path |
Path to the image file. |
detector |
Detector backend. "retinaface" provides these landmarks directly. |
These 5 landmarks are sufficient for basic face alignment and are
commonly used in face recognition pipelines. For more detailed
landmarks (478 points), use get_face_landmarks.
A list with named landmark coordinates:
left_eye - (x, y) coordinates
right_eye - (x, y) coordinates
nose - (x, y) coordinates
mouth_left - (x, y) coordinates
mouth_right - (x, y) coordinates
## Not run:
# Get key landmarks
lm <- get_key_landmarks("face.jpg")
# Calculate inter-pupillary distance
ipd <- sqrt(sum((lm$left_eye - lm$right_eye)^2))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.