From ccd906a2b8e030e25dc0315e6d596bad23b5df25 Mon Sep 17 00:00:00 2001 From: Paul Tunison Date: Fri, 18 Oct 2024 14:47:59 -0400 Subject: [PATCH] Fix pose generation to COCO method to correctly convert to xywh boxes --- tcn_hpl/data/utils/pose_generation/generate_pose_data.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcn_hpl/data/utils/pose_generation/generate_pose_data.py b/tcn_hpl/data/utils/pose_generation/generate_pose_data.py index 9fb24ae03..428dc3dca 100755 --- a/tcn_hpl/data/utils/pose_generation/generate_pose_data.py +++ b/tcn_hpl/data/utils/pose_generation/generate_pose_data.py @@ -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()