VisionFaceDetectorOptions

class VisionFaceDetectorOptions : NSObject

Options for specifying a face detector.

  • The face detector classification mode for characterizing attributes such as smiling. Defaults to .none.

    Declaration

    Swift

    var classificationMode: VisionFaceDetectorClassificationMode { get set }
  • The face detector performance mode that determines the accuracy of the results and the speed of the detection. Defaults to .fast.

    Declaration

    Swift

    var performanceMode: VisionFaceDetectorPerformanceMode { get set }
  • The face detector landmark mode that determines the type of landmark results returned by detection. Defaults to .none.

    Declaration

    Swift

    var landmarkMode: VisionFaceDetectorLandmarkMode { get set }
  • The face detector contour mode that determines the type of contour results returned by detection. Defaults to .none.

    The following detection results are returned when setting this mode to .all:

    performanceMode set to .fast, and both classificationMode and landmarkMode set to .none, then up to 5 faces will be returned with detected contours.

    performanceMode set to .accurate, or if classificationMode or landmarkMode is set to .all, then all detected faces will be returned, but only up to 5 faces will have detecteted contours.

    Declaration

    Swift

    var contourMode: VisionFaceDetectorContourMode { get set }
  • The smallest desired face size. The size is expressed as a proportion of the width of the head to the image width. For example, if a value of 0.1 is specified, then the smallest face to search for is roughly 10% of the width of the image being searched. Defaults to 0.1. This option does not apply to contour detection.

    Declaration

    Swift

    var minFaceSize: CGFloat { get set }
  • Whether the face tracking feature is enabled for face detection. For tracking a face in a video feed, setting this to YES will improve latency. Defaults to NO.

    Declaration

    Swift

    var isTrackingEnabled: Bool { get set }