MediaPipeTasksVision Framework Reference

FaceDetectorOptions

class FaceDetectorOptions : TaskOptions, NSCopying

Options for setting up a FaceDetector.

  • Running mode of the face detector task. Defaults to .image. FaceDetector 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 FaceDetectorLiveStreamDelegate protocol. This object must implement faceDetector(_:didFinishDetectionWithResult:timestampInMilliseconds:error:) to receive the results of performing asynchronous face detection on images (i.e, when runningMode = .liveStream).

    Declaration

    Swift

    weak var faceDetectorLiveStreamDelegate: FaceDetectorLiveStreamDelegate? { get set }
  • The minimum confidence score for the face detection to be considered successful. Defaults to 0.5.

    Declaration

    Swift

    var minDetectionConfidence: Float { get set }
  • The minimum non-maximum-suppression threshold for face detection to be considered overlapped. Defaults to 0.3.

    Declaration

    Swift

    var minSuppressionThreshold: Float { get set }