HandLandmarkerOptions
struct HandLandmarkerOptions: SendableConfiguration options for the MediaPipe HandLandmarker task.
-
init(baseOptions:runningMode:numHands:minHandDetectionConfidence:minHandPresenceConfidence:minTrackingConfidence:liveStreamResultHandler:)
Creates
HandLandmarkerOptionswith the specified configuration.Declaration
Swift
init(baseOptions: BaseOptions = BaseOptions(), runningMode: VisionRunningMode = .image, numHands: Int = 1, minHandDetectionConfidence: Float = 0.5, minHandPresenceConfidence: Float = 0.5, minTrackingConfidence: Float = 0.5, liveStreamResultHandler: HandLandmarkerOptions.LiveStreamResultHandler? = nil) -
Model asset and hardware delegate configuration.
Declaration
Swift
var baseOptions: BaseOptions -
Asynchronous delivery closure required when
runningModeis.liveStream.Declaration
Swift
var liveStreamResultHandler: HandLandmarkerOptions.LiveStreamResultHandler? -
Minimum confidence score for palm detection to succeed.
Declaration
Swift
var minHandDetectionConfidence: Float -
Minimum hand-presence confidence score during landmark regression.
Declaration
Swift
var minHandPresenceConfidence: Float -
Minimum landmark-tracking confidence before re-triggering palm detection on the next frame.
Declaration
Swift
var minTrackingConfidence: Float -
Maximum number of hands to detect per frame (must be positive).
Declaration
Swift
var numHands: Int -
Execution mode (
image,video, orliveStream).Declaration
Swift
var runningMode: VisionRunningMode -
Asynchronous callback invoked on a serial queue with live-stream hand landmarking results.
Declaration
Swift
typealias LiveStreamResultHandler = @Sendable (Result<HandLandmarkerResult, any Error>, Int) -> Void