Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pose generation to COCO method to correctly convert to xywh boxes #33

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tcn_hpl/data/utils/pose_generation/generate_pose_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ def predict_coco(
img = read_image(img_path, format="BGR")
boxes, scores, classes, keypoints_list = self.predict_single(img)

# boxes is output in xyxy (ltrb), but the COCO format wants xywh
# format.
boxes[:, 2] -= boxes[:, 0]
boxes[:, 3] -= boxes[:, 1]

# We will need non-numpy data types to insert into the structure to
# follow JSON compliance.
boxes_list = boxes.tolist()
Expand Down
Loading