FaceLandmarkerOptions
struct FaceLandmarkerOptions: SendableOptions for configuring a FaceLandmarker task (not Equatable because liveStreamResultHandler is a closure).
-
init(baseOptions:runningMode:numFaces:minFaceDetectionConfidence:minFacePresenceConfidence:minTrackingConfidence:outputFaceBlendshapes:outputFacialTransformationMatrixes:liveStreamResultHandler:)
Creates options for single-image detection of one face with
0.5confidence thresholds.Declaration
Swift
init(baseOptions: BaseOptions = BaseOptions(), runningMode: VisionRunningMode = .image, numFaces: Int = 1, minFaceDetectionConfidence: Float = 0.5, minFacePresenceConfidence: Float = 0.5, minTrackingConfidence: Float = 0.5, outputFaceBlendshapes: Bool = false, outputFacialTransformationMatrixes: Bool = false, liveStreamResultHandler: FaceLandmarkerOptions.LiveStreamResultHandler? = nil) -
Base options for model loading and hardware acceleration delegation.
Declaration
Swift
var baseOptions: BaseOptions -
Handler for
.liveStreamresults. Must benilin.imageand.videomodes.Declaration
Swift
var liveStreamResultHandler: FaceLandmarkerOptions.LiveStreamResultHandler? -
Minimum confidence score for face detection to be considered successful.
Declaration
Swift
var minFaceDetectionConfidence: Float -
Minimum confidence score of the face presence score in face landmark detection.
Declaration
Swift
var minFacePresenceConfidence: Float -
Minimum confidence score for face tracking to be considered successful.
Declaration
Swift
var minTrackingConfidence: Float -
Maximum number of faces to detect.
Declaration
Swift
var numFaces: Int -
Whether to output face blendshape scores for rendering 3D face models.
Declaration
Swift
var outputFaceBlendshapes: Bool -
Whether to output 4x4 facial transformation matrixes from the canonical face model.
Declaration
Swift
var outputFacialTransformationMatrixes: Bool -
Execution mode of the landmarker.
.liveStreamrequiresliveStreamResultHandler.Declaration
Swift
var runningMode: VisionRunningMode -
Receives
.liveStreamresults (or errors) and input timestamps on a private serial queue.Declaration
Swift
typealias LiveStreamResultHandler = @Sendable (Result<FaceLandmarkerResult, any Error>, Int) -> Void