google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.76k stars 5.18k forks source link

hand pose don't show in holistic solution #2680

Closed 1Zhaoning closed 3 years ago

1Zhaoning commented 3 years ago

Hi mediapipe team, I have tried the holistic solution of mediapipe both on a windows PC and a Nvidia Jetson Xavier platform. Basically, I was following the example scripts provided on this link-> https://google.github.io/mediapipe/solutions/holistic.html However, the visualization is completely different from the one you provided, and it never shows the hand pose (I have tried different videos and cameras). Is there something supposed to be enabled? Thanks a lot! Zhaoning

image

sgowroji commented 3 years ago

Hi @1Zhaoning, Could you please point us the exact code sample and platform used in reproducing the above issue. Thanks!

1Zhaoning commented 3 years ago

The example code I was using is this one:

For webcam input:

cap = cv2.VideoCapture(0) with mp_holistic.Holistic( min_detection_confidence=0.5, min_tracking_confidence=0.5) as holistic: while cap.isOpened(): success, image = cap.read() if not success: print("Ignoring empty camera frame.")

If loading a video, use 'break' instead of 'continue'.

  continue

# To improve performance, optionally mark the image as not writeable to
# pass by reference.
image.flags.writeable = False
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
results = holistic.process(image)

# Draw landmark annotation on the image.
image.flags.writeable = True
image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
mp_drawing.draw_landmarks(
    image,
    results.face_landmarks,
    mp_holistic.FACEMESH_CONTOURS,
    landmark_drawing_spec=None,
    connection_drawing_spec=mp_drawing_styles
    .get_default_face_mesh_contours_style())
mp_drawing.draw_landmarks(
    image,
    results.pose_landmarks,
    mp_holistic.POSE_CONNECTIONS,
    landmark_drawing_spec=mp_drawing_styles
    .get_default_pose_landmarks_style())
# Flip the image horizontally for a selfie-view display.
cv2.imshow('MediaPipe Holistic', cv2.flip(image, 1))
if cv2.waitKey(5) & 0xFF == 27:
  break

cap.release()

Actually, I found a pipeline image provided by your team. It seems my output didn't have the hand re-corp process, how exactly could I enable that? Thanks!!

image

1Zhaoning commented 3 years ago

Hi there, could anyone help with this issue? Thanks!

aryan-f commented 3 years ago

You aren't drawing them. The example code for holistic doesn't include that by default. You can use the code here.

google-ml-butler[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 3 years ago

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 3 years ago

Are you satisfied with the resolution of your issue? Yes No