feat: add MediaPipe hand landmark support#2283
Open
tarunbommawar27 wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2283 +/- ##
=======================================
Coverage 79% 79%
=======================================
Files 66 66
Lines 8567 8569 +2
=======================================
+ Hits 6726 6732 +6
+ Misses 1841 1837 -4 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before submitting
Description
Adds support for MediaPipe hand landmarks in the key points module.
This PR adds a new
Skeleton.HANDdefinition for MediaPipe's 21 hand landmarks and extendsKeyPoints.from_mediapipe()to parse hand landmark outputs from both current and legacy MediaPipe result formats.Type of Change
Motivation and Context
MediaPipe hand landmarks contain 21 keypoints per hand. The existing
Skeletonenum supported COCO, GHUM, and FaceMesh skeletons, but did not include a hand skeleton. This meantEdgeAnnotatorcould not automatically draw hand landmark connections.KeyPoints.from_mediapipe()also handled pose and face landmarks, but did not handle hand landmarks. This PR adds support for bothhand_landmarksandmulti_hand_landmarks.Closes #2170
Changes Made
Added
Skeleton.HANDwith 21 vertices and 20 MediaPipe hand landmark edgesAdded automatic lookup support through existing
SKELETONS_BY_VERTEX_COUNTandSKELETONS_BY_EDGE_COUNTExtended
KeyPoints.from_mediapipe()to support:hand_landmarksmulti_hand_landmarksUpdated MediaPipe fake test helpers to support hand landmark test cases
Added tests for the hand skeleton definition and MediaPipe hand landmark parsing
Made MediaPipe confidence extraction robust by defaulting missing
visibilityvalues to1.0Testing
Commands run:
Result:
Google Colab (optional)
Not applicable.
Screenshots/Videos (optional)
Not applicable.
Additional Notes
The skeleton edges use 1-based indexing to match the existing
EdgeAnnotatorbehavior, which subtracts1before indexing into keypoint arrays.