MLKitFaceDetection Framework Reference

Face

  class 
 Face 
 : 
 NSObject 
 

A human face detected in an image.

  • The rectangle containing the detected face relative to the image in the view coordinate system.

    Declaration

    Swift

      var 
     frame 
     : 
     CGRect 
     { 
     get 
     } 
     
    
  • An array of all the landmarks in the detected face.

    Declaration

    Swift

      var 
     landmarks 
     : 
     [ 
      FaceLandmark 
     
     ] 
     { 
     get 
     } 
     
    
  • An array of all the contours in the detected face.

    Declaration

    Swift

      var 
     contours 
     : 
     [ 
      FaceContour 
     
     ] 
     { 
     get 
     } 
     
    
  • Indicates whether the face has a tracking ID.

    Declaration

    Swift

      var 
     hasTrackingID 
     : 
     Bool 
     { 
     get 
     } 
     
    
  • The tracking identifier of the face.

    Declaration

    Swift

      var 
     trackingID 
     : 
     Int 
     { 
     get 
     } 
     
    
  • Indicates whether the detector found the head x euler angle.

    Declaration

    Swift

      var 
     hasHeadEulerAngleX 
     : 
     Bool 
     { 
     get 
     } 
     
    
  • 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

    Swift

      var 
     headEulerAngleX 
     : 
     CGFloat 
     { 
     get 
     } 
     
    
  • Indicates whether the detector found the head y euler angle.

    Declaration

    Swift

      var 
     hasHeadEulerAngleY 
     : 
     Bool 
     { 
     get 
     } 
     
    
  • 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

    Swift

      var 
     headEulerAngleY 
     : 
     CGFloat 
     { 
     get 
     } 
     
    
  • Indicates whether the detector found the head z euler angle.

    Declaration

    Swift

      var 
     hasHeadEulerAngleZ 
     : 
     Bool 
     { 
     get 
     } 
     
    
  • 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

    Swift

      var 
     headEulerAngleZ 
     : 
     CGFloat 
     { 
     get 
     } 
     
    
  • Indicates whether a smiling probability is available.

    Declaration

    Swift

      var 
     hasSmilingProbability 
     : 
     Bool 
     { 
     get 
     } 
     
    
  • Probability that the face is smiling.

    Declaration

    Swift

      var 
     smilingProbability 
     : 
     CGFloat 
     { 
     get 
     } 
     
    
  • Indicates whether a left eye open probability is available.

    Declaration

    Swift

      var 
     hasLeftEyeOpenProbability 
     : 
     Bool 
     { 
     get 
     } 
     
    
  • Probability that the face’s left eye is open.

    Declaration

    Swift

      var 
     leftEyeOpenProbability 
     : 
     CGFloat 
     { 
     get 
     } 
     
    
  • Indicates whether a right eye open probability is available.

    Declaration

    Swift

      var 
     hasRightEyeOpenProbability 
     : 
     Bool 
     { 
     get 
     } 
     
    
  • Probability that the face’s right eye is open.

    Declaration

    Swift

      var 
     rightEyeOpenProbability 
     : 
     CGFloat 
     { 
     get 
     } 
     
    
  • Unavailable.

  • Returns the landmark, if any, of the given type in this detected face.

    Declaration

    Swift

      func 
     landmark 
     ( 
     ofType 
     type 
     : 
      FaceLandmarkType 
     
     ) 
     -> 
      FaceLandmark 
     
     ? 
     
    

    Parameters

    type

    The type of the facial landmark.

    Return Value

    The landmark of the given type in this face. nil if there isn’t one.

  • Returns the contour, if any, of the given type in this detected face.

    Declaration

    Swift

      func 
     contour 
     ( 
     ofType 
     type 
     : 
      FaceContourType 
     
     ) 
     -> 
      FaceContour 
     
     ? 
     
    

    Parameters

    type

    The type of the facial contour.

    Return Value

    The contour of the given type in this face. nil if there isn’t one.

Create a Mobile Website
View Site in Mobile | Classic
Share by: