(bbox_xyxy)
| 228 | |
| 229 | @staticmethod |
| 230 | def _xyxy_to_tlwh_array(bbox_xyxy): |
| 231 | if isinstance(bbox_xyxy, np.ndarray): |
| 232 | bbox_tlwh = bbox_xyxy.copy() |
| 233 | elif isinstance(bbox_xyxy, torch.Tensor): |
| 234 | bbox_tlwh = bbox_xyxy.clone() |
| 235 | bbox_tlwh[:, 2] = bbox_xyxy[:, 2] - bbox_xyxy[:, 0] |
| 236 | bbox_tlwh[:, 3] = bbox_xyxy[:, 3] - bbox_xyxy[:, 1] |
| 237 | return bbox_tlwh |
| 238 | |
| 239 | def _xywh_to_xyxy(self, bbox_xywh): |
| 240 | x, y, w, h = bbox_xywh |