Skip to content

Commit

Permalink
fix bbox transform (#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
ly015 committed May 24, 2022
1 parent 70fa72b commit 28e55e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mmpose/core/bbox/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def bbox_xyxy2xywh(bbox_xyxy):
shaped (n, 4) or (n, 5). (left, top, width, height, [score])
"""
bbox_xywh = bbox_xyxy.copy()
bbox_xywh[:, 2] = bbox_xywh[:, 2] - bbox_xywh[:, 0] + 1
bbox_xywh[:, 3] = bbox_xywh[:, 3] - bbox_xywh[:, 1] + 1
bbox_xywh[:, 2] = bbox_xywh[:, 2] - bbox_xywh[:, 0]
bbox_xywh[:, 3] = bbox_xywh[:, 3] - bbox_xywh[:, 1]

return bbox_xywh

Expand All @@ -31,8 +31,8 @@ def bbox_xywh2xyxy(bbox_xywh):
(n, 5). (left, top, right, bottom, [score])
"""
bbox_xyxy = bbox_xywh.copy()
bbox_xyxy[:, 2] = bbox_xyxy[:, 2] + bbox_xyxy[:, 0] - 1
bbox_xyxy[:, 3] = bbox_xyxy[:, 3] + bbox_xyxy[:, 1] - 1
bbox_xyxy[:, 2] = bbox_xyxy[:, 2] + bbox_xyxy[:, 0]
bbox_xyxy[:, 3] = bbox_xyxy[:, 3] + bbox_xyxy[:, 1]

return bbox_xyxy

Expand Down

0 comments on commit 28e55e6

Please sign in to comment.