MediaPipeTasksVision Framework Reference

HandLandmarkerOptions

struct HandLandmarkerOptions: Sendable

Configuration options for the MediaPipe HandLandmarker task.

  • Creates HandLandmarkerOptions with 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 runningMode is .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, or liveStream).

    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