Skip to content

Commit

Permalink
Merge pull request #33 from Purg/dev/fix-pose-gen-coco-bbox-output
Browse files Browse the repository at this point in the history
Fix pose generation to COCO method to correctly convert to xywh boxes
  • Loading branch information
Purg authored Oct 21, 2024
2 parents 4c3effa + ccd906a commit f172419
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit f172419

Please sign in to comment.