google-ai-edge / mediapipe

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

Holistic Landmarker index #5490

Closed Terrywang2001 closed 3 months ago

Terrywang2001 commented 3 months ago

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

No

OS Platform and Distribution

Ubuntu 20.04

MediaPipe Tasks SDK version

No response

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

landmark index

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

Python

Describe the actual behavior

I couldn't find any file which contains the full index list for the holistic landmarder

Describe the expected behaviour

I think there should be a file telling me what are the indices of the keypoints.

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

I am just looking for a file telling me what are the indices of the keypoints from holistic landmarker.

Other info / Complete Logs

No response

aliakseibrown commented 3 months ago

The landmarks indexing in the MediaPipe models is predefined and consistent across all uses of the model.

Pose Landmarks: There are 33 pose landmarks, indexed from 0 to 32. Each landmark corresponds to a key point in the body, such as the nose, left eye, right shoulder, left hip, etc. Face Landmarks: There are 468 face landmarks, indexed from 0 to 467. These landmarks map out the full face, including the eyes, eyebrows, nose, mouth, and the outer contour of the face. Hand Landmarks: There are 21 landmarks for each hand, indexed from 0 to 20. These landmarks map out the palm, thumb, and each finger.

The landmarks are then outputted in the POSE_LANDMARKS, LEFT_HAND_LANDMARKS, RIGHT_HAND_LANDMARKS, and FACE_LANDMARKS streams.

To access a specific landmark, you would need to index into the list of landmarks. For example, to access the left shoulder pose landmark (index 11), you would use pose_landmarks[11]. Similarly, to access the tip of the thumb on the left hand (index 4), you would use left_hand_landmarks[4] in

# Process the image.
results = mp_holistic.process(image)

# Access the landmarks.
pose_landmarks = results.pose_landmarks
face_landmarks = results.face_landmarks
left_hand_landmarks = results.left_hand_landmarks
right_hand_landmarks = results.right_hand_landmarks

# For example, to access the shoulder pose landmark:
first_pose_landmark = pose_landmarks[11]

# Or to access the tip of the thumb on the left hand:
tip_of_the_thumb_left_hand = left_hand_landmarks[4] 
Terrywang2001 commented 3 months ago

Thanks a lot!

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

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

Terrywang2001 commented 3 months ago

But can I use the process function in current holistic model? Cause I only see process function in legacy holistic model.

kuaashish commented 3 months ago

Hi @Terrywang2001,

We believe that for now, you will not be able to use the function as it is not included in the new Holistic model. Please allow us some time to explore alternative methods that may allow you to use this function.

Thank you!!

Terrywang2001 commented 3 months ago

thanks!

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

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