Add COCO Wholebody 133 keypoint schema and generic.py support#226
Merged
AmitMY merged 2 commits intoJun 20, 2026
Merged
Conversation
Introduces cocowholebody133_header.py as a shared schema definition for the
133-keypoint COCO Wholebody format (23 body + 68 face + 21 left hand + 21 right
hand), and registers it as a known pose format in generic.py with full support
across detection, leg hiding, shoulder/hand utilities, and normalization helpers.
Also fixes several bugs present in the upstream fork: incorrect component name
("pose_keypoints_2d" instead of "BODY") and string-index point names in
pose_hide_legs, wrong hand component name suffix in get_hand_wrist_index, and the
missing coco_wholebody_133 case in get_standard_components_for_known_format.
Co-Authored-By: catherine-o-brien <catherine-o-brien@users.noreply.github.com>
Co-Authored-By: GerrySant <GerrySant@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
(CI fails, but seems unrelated to this PR) |
…apose_133 derives from it Research confirmed that AlphaPose 133, MMPose wholebody, OpenPifPaf wholebody, and SDPose all output the same COCO Wholebody 133 keypoints in the same order. The previous alphapose_133.py duplicated the schema definition with minor naming inconsistencies (face_N underscore, side-prefixed hand point names, no face limbs). cocowholebody133_header.py is now the single source of truth for the 133-keypoint COCO Wholebody format: - HAND_POINTS uses shared "hand_N" naming (same for both left/right components), matching the AlphaPose convention and enabling normalize_hands_3d to work correctly - FACE_LIMBS_NAMES adds full face connectivity (jaw, brows, eyes, nose, lips) - All limb index pairs are pre-computed as module-level constants (BODY_LIMBS, FACE_LIMBS, HAND_LIMBS) and exported for downstream importers alphapose_133.py now imports BODY_POINTS, FACE_POINTS, HAND_POINTS and pre-computed limb pairs from cocowholebody133_header.py, keeping only its _133-suffixed component names for backward compatibility. generic.py hand point lookups for coco_wholebody_133 updated to use "hand_N" names. Co-Authored-By: catherine-o-brien <catherine-o-brien@users.noreply.github.com> Co-Authored-By: GerrySant <GerrySant@users.noreply.github.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Jun 20, 2026
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.
Context
AlphaPose 133, MMPose wholebody, OpenPifPaf wholebody, and SDPose all output the same COCO Wholebody 133-keypoint format (23 body + 68 face + 21 left hand + 21 right hand = 133, in the same canonical ordering). Rather than each estimator duplicating or subtly diverging from this schema, this PR establishes a single canonical definition and makes the existing
alphapose_133derive from it. Subsequent PRs will add the individual estimator loaders (MMPose, OpenPifPaf, SDPose) on top.Changes
New canonical schema:
pose_format/utils/cocowholebody133_header.pySingle source of truth for the COCO Wholebody 133-keypoint format:
BODY_POINTS— 23 keypoints (17 standard COCO body + 6 feet)FACE_POINTS— 68 keypoints, namedface-0…face-67(dash separator, matching the COCO Wholebody / MMPose convention)HAND_POINTS— 21 keypoints per hand, namedhand_0…hand_20(shared between LEFT_HAND and RIGHT_HAND components; the side is captured by the component name, not the point name — this is required fornormalize_hands_3dto work correctly)FACE_LIMBS_NAMES— full face connectivity (jaw contour, brows, nose bridge, eyes, lips): 67 edgesBODY_LIMBS,FACE_LIMBS,HAND_LIMBSexported as module-level constants for downstream importerscocowholebody_components()— assembles the fourPoseHeaderComponentobjectspose_format/utils/alphapose_133.pynow derives from the canonical headerPreviously duplicated body point names, body limbs, and hand point names with minor inconsistencies (no face limbs; generic
hand_Nnaming that happened to match the canonical standard; face usedface_Nunderscore separator). Now importsBODY_POINTS,FACE_POINTS,HAND_POINTS,BODY_LIMBS,FACE_LIMBS,HAND_LIMBSdirectly fromcocowholebody133_header. Retains_133-suffixed component names (BODY_133,FACE_133, etc.) for backward compatibility with serialized files.pose_format/utils/generic.pyRegisters
"coco_wholebody_133"as aKnownPoseFormatwith full support across all per-format utility functions. Hand point lookups use the sharedhand_Nnames consistent with the canonical header.pose_format/utils/generic_test.pyParametric tests extended to cover
coco_wholebody_133. Three standalone header unit tests verify total keypoint count (133), component names, and that all limb indices are in bounds.Test plan
pytest src/python/pose_format/utils/generic_test.py src/python/pose_format/utils/alphapose_test.py -vdetect_known_pose_formatcorrectly identifies bothalphapose_133andcoco_wholebody_133fake posespose_hide_legs,correct_wrists,normalize_pose_sizework forcoco_wholebody_133alphapose_133loader round-trips correctly (component names unchanged)🤖 Generated with Claude Code