MediaPipeTasksVision Framework Reference

MPPGestureRecognizerOptions


@interface MPPGestureRecognizerOptions : MPPTaskOptions <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

    Objective-C

    @property (nonatomic) MPPRunningMode runningMode;
  • 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

    Objective-C

    @property (nonatomic, weak, nullable) id<MPPGestureRecognizerLiveStreamDelegate> gestureRecognizerLiveStreamDelegate;
  • Sets the maximum number of hands can be detected by the GestureRecognizer.

    Declaration

    Objective-C

    @property (nonatomic) NSInteger numHands;
  • Sets minimum confidence score for the hand detection to be considered successful

    Declaration

    Objective-C

    @property (nonatomic) float minHandDetectionConfidence;
  • Sets minimum confidence score of hand presence score in the hand landmark detection.

    Declaration

    Objective-C

    @property (nonatomic) float minHandPresenceConfidence;
  • Sets the minimum confidence score for the hand tracking to be considered successful.

    Declaration

    Objective-C

    @property (nonatomic) float minTrackingConfidence;
  • 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

    Objective-C

    @property (nonatomic, copy, nullable) MPPClassifierOptions *cannedGesturesClassifierOptions;
  • 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

    Objective-C

    @property (nonatomic, copy, nullable) MPPClassifierOptions *customGesturesClassifierOptions;