Skip to content

Conversation

@GerrySant
Copy link

This PR adds support for converting AlphaPose WholeBody (133 keypoints) JSON outputs
into pose-format (.pose) files.

  • Introduces a new json_to_pose CLI tool
  • Adds AlphaPose WholeBody-133 parser and keypoint reordering utilities
  • Supports optional metadata extraction from JSON or original RGB video
  • Documents the conversion workflow in the README

This enables seamless integration of AlphaPose outputs into pose-format pipelines,
which is particularly useful for sign language processing workflows.

- Introduce json_to_pose CLI tool for converting AlphaPose JSON outputs to .pose
- Add AlphaPose WholeBody (133 keypoints) parser and keypoint reordering utility
- Support optional metadata extraction (fps, width, height) from JSON or original video
- Register json_to_pose as an installable console script
- Document JSON → .pose conversion workflow in README
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new CLI tool for converting AlphaPose WholeBody-133 JSON outputs into pose-format (.pose) files, enabling seamless integration of AlphaPose outputs into pose-format pipelines.

Changes:

  • Added json_to_pose CLI tool for converting JSON pose estimation outputs to .pose format
  • Implemented AlphaPose WholeBody-133 parser with keypoint reordering utilities
  • Added support for optional metadata extraction from JSON or original RGB video

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 7 comments.

File Description
src/python/pyproject.toml Registers the new json_to_pose CLI command
src/python/pose_format/utils/alphapose.py Implements AlphaPose WholeBody-133 parsing, components definition, and keypoint reordering
src/python/pose_format/bin/json_to_pose.py Provides the CLI tool for converting JSON to .pose format with metadata extraction
README.md Documents the new conversion workflow and usage examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

PoseHeaderComponent(
name="BODY",
points=BODY_POINTS,
limbs= map_limbs(BODY_POINTS, BODY_LIMBS_NAMES),
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace after the comma on line 98. This is inconsistent with line 114 and 122 which don't have trailing spaces.

Suggested change
limbs= map_limbs(BODY_POINTS, BODY_LIMBS_NAMES),
limbs= map_limbs(BODY_POINTS, BODY_LIMBS_NAMES),

Copilot uses AI. Check for mistakes.
PoseHeaderComponent(
name="LEFT_HAND",
points=LEFT_HAND_POINTS,
limbs= map_limbs(LEFT_HAND_POINTS, LEFT_HAND_LIMBS_NAMES),
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace after the comma on line 114. This is inconsistent with line 122 which doesn't have a trailing space.

Copilot uses AI. Check for mistakes.
from ..numpy.pose_body import NumPyPoseBody
from ..pose import Pose
from ..pose_header import PoseHeader, PoseHeaderComponent, PoseHeaderDimensions
from pose_format.utils.openpose import hand_colors
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import "hand_colors" from "pose_format.utils.openpose" is unused and should be removed.

Suggested change
from pose_format.utils.openpose import hand_colors

Copilot uses AI. Check for mistakes.
"right_big_toe","right_small_toe","right_heel",
]

FACE_POINTS = [f"face-{i}" for i in range(68)]
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent naming convention: face points use hyphens ("face-0", "face-1") while hand points use underscores ("left_hand_0", "right_hand_0"). This should be consistent for maintainability.

Suggested change
FACE_POINTS = [f"face-{i}" for i in range(68)]
FACE_POINTS = [f"face_{i}" for i in range(68)]

Copilot uses AI. Check for mistakes.
Comment on lines +204 to +205
video_path : string
Path to input video file.
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name in the docstring is "video_path" but the actual parameter is "input_path". The docstring should be updated to match the function signature.

Suggested change
video_path : string
Path to input video file.
input_path : string
Path to input AlphaPose JSON file.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is probably wrong, but it probably means the docstring is not good

Comment on lines +200 to +210
Loads alphapose_wholebody pose data
Parameters
----------
video_path : string
Path to input video file.
Returns
-------
Pose
Loaded pose data with header and body
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring is incomplete - it doesn't document the parameters "version", "fps", "width", "height", or "depth".

Suggested change
Loads alphapose_wholebody pose data
Parameters
----------
video_path : string
Path to input video file.
Returns
-------
Pose
Loaded pose data with header and body
Loads alphapose_wholebody pose data.
Parameters
----------
input_path : str
Path to the input AlphaPose JSON file.
version : float, optional
Pose format version stored in the :class:`PoseHeader`. Defaults to 0.2.
fps : float, optional
Frames per second used in the :class:`NumPyPoseBody`. May be overridden by JSON metadata. Defaults to 24.
width : int, optional
Frame width in pixels for :class:`PoseHeaderDimensions`. May be overridden by JSON metadata. Defaults to 1000.
height : int, optional
Frame height in pixels for :class:`PoseHeaderDimensions`. May be overridden by JSON metadata. Defaults to 1000.
depth : int, optional
Depth dimension for :class:`PoseHeaderDimensions`. Defaults to 0.
Returns
-------
Pose
Loaded pose data with header and body.

Copilot uses AI. Check for mistakes.
The library supports converting pose estimation outputs stored as `.json` files into the `.pose` format via `json_to_pose` utility.

> **Note**
> - At the moment, `json_to_pose` only supports [AlphaPose](https://github.com/MVIG-SJTU/AlphaPose) models with **133 keypoints** JSON files with 133 keypoints.
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated text in the README: "JSON files with 133 keypoints" appears twice in the same sentence.

Suggested change
> - At the moment, `json_to_pose` only supports [AlphaPose](https://github.com/MVIG-SJTU/AlphaPose) models with **133 keypoints** JSON files with 133 keypoints.
> - At the moment, `json_to_pose` only supports [AlphaPose](https://github.com/MVIG-SJTU/AlphaPose) models whose JSON outputs contain **133 keypoints**.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants