MediaPipeTasksVision Framework Reference

FaceLandmarkerOptions

class FaceLandmarkerOptions : TaskOptions, NSCopying

Options for setting up a FaceLandmarker.

  • Running mode of the face landmark dection task. Defaults to .image. FaceLandmarker can be created with one of the following running modes:

    1. .image: The mode for performing face detection on single image inputs.
    2. .video: The mode for performing face detection on the decoded frames of a video.
    3. .liveStream: The mode for performing face detection on a live stream of input data, such as from the camera.

    Declaration

    Swift

    var runningMode: RunningMode { get set }
  • An object that confirms to FaceLandmarkerLiveStreamDelegate protocol. This object must implement faceLandmarker(_:didFinishDetectionWithResult:timestampInMilliseconds:error:) to receive the results of performing asynchronous face landmark detection on images (i.e, when runningMode = .liveStream).

    Declaration

    Swift

    weak var faceLandmarkerLiveStreamDelegate: FaceLandmarkerLiveStreamDelegate? { get set }
  • The maximum number of faces can be detected by the FaceLandmarker. Defaults to 1.

    Declaration

    Swift

    var numFaces: Int { get set }
  • The minimum confidence score for the face detection to be considered successful. Defaults to 0.5.

    Declaration

    Swift

    var minFaceDetectionConfidence: Float { get set }
  • The minimum confidence score of face presence score in the face landmark detection. Defaults to 0.5.

    Declaration

    Swift

    var minFacePresenceConfidence: Float { get set }
  • The minimum confidence score for the face tracking to be considered successful. Defaults to 0.5.

    Declaration

    Swift

    var minTrackingConfidence: Float { get set }
  • Whether FaceLandmarker outputs face blendshapes classification. Face blendshapes are used for rendering the 3D face model.

    Declaration

    Swift

    var outputFaceBlendshapes: Bool { get set }
  • Whether FaceLandmarker outputs facial transformation_matrix. Facial transformation matrix is used to transform the face landmarks in canonical face to the detected face, so that users can apply face effects on the detected landmarks.

    Declaration

    Swift

    var outputFacialTransformationMatrixes: Bool { get set }