MediaPipeTasksVision Framework Reference

GestureRecognizerOptions

class GestureRecognizerOptions : TaskOptions, NSCopying

Options for setting up a GestureRecognizer.

  • Running mode of the gesture recognizer task. Defaults to .video. GestureRecognizer can be created with one of the following running modes:

    1. image: The mode for performing gesture recognition on single image inputs.
    2. video: The mode for performing gesture recognition on the decoded frames of a video.
    3. liveStream: The mode for performing gesture recognition on a live stream of input data, such as from the camera.

    Declaration

    Swift

    var runningMode: RunningMode { get set }
  • An object that confirms to GestureRecognizerLiveStreamDelegate protocol. This object must implement gestureRecognizer(_:didFinishRecognitionWithResult:timestampInMilliseconds:error:) to receive the results of performing asynchronous gesture recognition on images (i.e, when runningMode = .liveStream).

    Declaration

    Swift

    weak var gestureRecognizerLiveStreamDelegate: GestureRecognizerLiveStreamDelegate? { get set }
  • Sets the maximum number of hands can be detected by the GestureRecognizer.

    Declaration

    Swift

    var numHands: Int { get set }
  • Sets minimum confidence score for the hand detection to be considered successful

    Declaration

    Swift

    var minHandDetectionConfidence: Float { get set }
  • Sets minimum confidence score of hand presence score in the hand landmark detection.

    Declaration

    Swift

    var minHandPresenceConfidence: Float { get set }
  • Sets the minimum confidence score for the hand tracking to be considered successful.

    Declaration

    Swift

    var minTrackingConfidence: Float { get set }
  • Sets the optional ClassifierOptions controlling the canned gestures classifier, such as score threshold, allow list and deny list of gestures. The categories for canned gesture classifiers are: [“None”, “Closed_Fist”, “Open_Palm”, “Pointing_Up”, “Thumb_Down”, “Thumb_Up”, “Victory”, “ILoveYou”].

    TODO: Note this option is subject to change, after scoring merging calculator is implemented.

    Declaration

    Swift

    @NSCopying var cannedGesturesClassifierOptions: ClassifierOptions? { get set }
  • Sets the optional ClassifierOptions controlling the custom gestures classifier, such as score threshold, allow list and deny list of gestures.

    TODO: Note this option is subject to change, after scoring merging calculator is implemented.

    Declaration

    Swift

    @NSCopying var customGesturesClassifierOptions: ClassifierOptions? { get set }