MediaPipeTasksVision Framework Reference

HandLandmarker

final class HandLandmarker

Detects 2D normalized hand landmarks, 3D world landmarks, and handedness across images, video frames, and live camera streams.

  • Complete skeleton topology combining palm and all five finger connection lists.

    Declaration

    Swift

    static let handConnections: [Connection]
  • Connections linking landmarks along the index finger (5 through 8).

    Declaration

    Swift

    static let handIndexFingerConnections: [Connection]
  • Connections linking landmarks along the middle finger (9 through 12).

    Declaration

    Swift

    static let handMiddleFingerConnections: [Connection]
  • Connections linking landmarks across the palm (wrist and finger bases).

    Declaration

    Swift

    static let handPalmConnections: [Connection]
  • Connections linking landmarks along the pinky finger (17 through 20).

    Declaration

    Swift

    static let handPinkyConnections: [Connection]
  • Connections linking landmarks along the ring finger (13 through 16).

    Declaration

    Swift

    static let handRingFingerConnections: [Connection]
  • Connections linking landmarks along the thumb (1 through 4).

    Declaration

    Swift

    static let handThumbConnections: [Connection]
  • Creates a HandLandmarker in .image mode using the model asset bundle at modelPath.

    Declaration

    Swift

    convenience init(modelPath: String) throws
  • Creates a HandLandmarker configured with options.

    Declaration

    Swift

    init(options: HandLandmarkerOptions) throws
  • Detects hand landmarks in a standalone image (.image running mode only).

    Declaration

    Swift

    final func detect(image: MPImage, imageProcessingOptions: ImageProcessingOptions? = nil) throws -> HandLandmarkerResult
  • Detects hand landmarks in a sequential videoFrame at monotonically increasing timestampInMilliseconds (.video running mode only).

    Declaration

    Swift

    final func detect(videoFrame: MPImage, timestampInMilliseconds: Int, imageProcessingOptions: ImageProcessingOptions? = nil) throws -> HandLandmarkerResult
  • Submits a live camera image at monotonically increasing timestampInMilliseconds for asynchronous result delivery (.liveStream running mode only).

    Declaration

    Swift

    final func detectAsync(image: MPImage, timestampInMilliseconds: Int, imageProcessingOptions: ImageProcessingOptions? = nil) throws