google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://mediapipe.dev
Apache License 2.0
26.29k stars 5.05k forks source link

How to turn off the automatic pop-up gesture in gesture recognition #5350

Open 327635328 opened 2 months ago

327635328 commented 2 months ago

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

None

OS Platform and Distribution

linux

MediaPipe Tasks SDK version

0.10.11

Task name (e.g. Image classification, Gesture recognition etc.)

Gesture recognition

Programming Language and version (e.g. C++, Python, Java)

python

Describe the actual behavior

A pattern automatically appears when I bizzan

Describe the expected behaviour

All I want is a spot on my hand

Standalone code/steps you may have used to try to get what you need

I just want the coordinate points on the hand, how to turn off the automatic pop-up gesture pattern in the model

base_options = python.BaseOptions(model_asset_path='hand_landmarker.task',delegate=mp.tasks.BaseOptions.Delegate.GPU)

...

mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=img_rgb)
    detection_result = detector.detect(mp_image)
annotated_image = draw_landmarks_on_image(mp_image.numpy_view(), detection_result)

def draw_landmarks_on_image(rgb_image, detection_result):
  hand_landmarks_list = detection_result.hand_landmarks
  handedness_list = detection_result.handedness

  print(hand_landmarks_list)
  annotated_image = np.copy(rgb_image)
  return annotated_image

Other info / Complete Logs

No response

327635328 commented 2 months ago
image
327635328 commented 2 months ago

Seems to be using gesture_recognizer.task, Am I right?.but i do not how to use canned_gesture_classifier_options options = vision.GestureRecognizerOptions(base_options=base_options, num_hands=1, canned_gesture_classifier_options=???)