Page Summary
-
MLKFacerepresents a human face detected within an image, providing information about its location and features. -
It includes properties like the face's bounding box (
frame), facial landmarks (landmarks), and contours (contours). -
MLKFacecan also provide information about head pose (Euler angles), smiling probability, and eye open probabilities. -
Developers can access specific landmarks and contours using their respective types through methods like
landmarkOfType:andcontourOfType:. -
Tracking faces across frames is supported if a
trackingIDis available, indicated by thehasTrackingIDproperty.
MLKFace
@interface
MLKFace
:
NSObject
A human face detected in an image.
-
The rectangle containing the detected face relative to the image in the view coordinate system.
Declaration
Objective-C
@property ( nonatomic , readonly ) CGRect frame ; -
An array of all the landmarks in the detected face.
Declaration
Objective-C
@property ( nonatomic , readonly ) NSArray < MLKFaceLandmark *> * _Nonnull landmarks ; -
An array of all the contours in the detected face.
Declaration
Objective-C
@property ( nonatomic , readonly ) NSArray < MLKFaceContour *> * _Nonnull contours ; -
Indicates whether the face has a tracking ID.
Declaration
Objective-C
@property ( nonatomic , readonly ) BOOL hasTrackingID ; -
The tracking identifier of the face.
Declaration
Objective-C
@property ( nonatomic , readonly ) NSInteger trackingID ; -
Indicates whether the detector found the head x euler angle.
Declaration
Objective-C
@property ( nonatomic , readonly ) BOOL hasHeadEulerAngleX ; -
Indicates the rotation of the face about the horizontal axis of the image. Positive x euler angle is when the face is turned upward in the image that is being processed.
Declaration
Objective-C
@property ( nonatomic , readonly ) CGFloat headEulerAngleX ; -
Indicates whether the detector found the head y euler angle.
Declaration
Objective-C
@property ( nonatomic , readonly ) BOOL hasHeadEulerAngleY ; -
Indicates the rotation of the face about the vertical axis of the image. Positive y euler angle is when the face is turned towards the right side of the image that is being processed.
Declaration
Objective-C
@property ( nonatomic , readonly ) CGFloat headEulerAngleY ; -
Indicates whether the detector found the head z euler angle.
Declaration
Objective-C
@property ( nonatomic , readonly ) BOOL hasHeadEulerAngleZ ; -
Indicates the rotation of the face about the axis pointing out of the image. Positive z euler angle is a counter-clockwise rotation within the image plane.
Declaration
Objective-C
@property ( nonatomic , readonly ) CGFloat headEulerAngleZ ; -
Indicates whether a smiling probability is available.
Declaration
Objective-C
@property ( nonatomic , readonly ) BOOL hasSmilingProbability ; -
Probability that the face is smiling.
Declaration
Objective-C
@property ( nonatomic , readonly ) CGFloat smilingProbability ; -
Indicates whether a left eye open probability is available.
Declaration
Objective-C
@property ( nonatomic , readonly ) BOOL hasLeftEyeOpenProbability ; -
Probability that the face’s left eye is open.
Declaration
Objective-C
@property ( nonatomic , readonly ) CGFloat leftEyeOpenProbability ; -
Indicates whether a right eye open probability is available.
Declaration
Objective-C
@property ( nonatomic , readonly ) BOOL hasRightEyeOpenProbability ; -
Probability that the face’s right eye is open.
Declaration
Objective-C
@property ( nonatomic , readonly ) CGFloat rightEyeOpenProbability ; -
Unavailable.
Declaration
Objective-C
- ( nonnull instancetype ) init ; -
Returns the landmark, if any, of the given type in this detected face.
Declaration
Objective-C
- ( nullable MLKFaceLandmark * ) landmarkOfType :( nonnull MLKFaceLandmarkType ) type ;Parameters
typeThe type of the facial landmark.
Return Value
The landmark of the given type in this face.
nilif there isn’t one. -
Returns the contour, if any, of the given type in this detected face.
Declaration
Objective-C
- ( nullable MLKFaceContour * ) contourOfType :( nonnull MLKFaceContourType ) type ;Parameters
typeThe type of the facial contour.
Return Value
The contour of the given type in this face.
nilif there isn’t one.


