diff --git a/ultralytics/models/yolo/obb/val.py b/ultralytics/models/yolo/obb/val.py index e16d75f2..c9f70b13 100644 --- a/ultralytics/models/yolo/obb/val.py +++ b/ultralytics/models/yolo/obb/val.py @@ -61,7 +61,7 @@ class OBBValidator(DetectionValidator): Returns: (torch.Tensor): Correct prediction matrix of shape [N, 10] for 10 IoU levels. """ - iou = batch_probiou(gt_bboxes, torch.cat([detections[:, :4], detections[:, -2:-1]], dim=-1)) + iou = batch_probiou(gt_bboxes, torch.cat([detections[:, :4], detections[:, -1:]], dim=-1)) return self.match_predictions(detections[:, 5], gt_cls, iou) def _prepare_batch(self, si, batch): diff --git a/ultralytics/utils/ops.py b/ultralytics/utils/ops.py index 12ac0461..d589436d 100644 --- a/ultralytics/utils/ops.py +++ b/ultralytics/utils/ops.py @@ -263,7 +263,7 @@ def non_max_suppression( c = x[:, 5:6] * (0 if agnostic else max_wh) # classes scores = x[:, 4] # scores if rotated: - boxes = torch.cat((x[:, :2] + c, x[:, 2:4], x[:, -2:-1]), dim=-1) # xywhr + boxes = torch.cat((x[:, :2] + c, x[:, 2:4], x[:, -1:]), dim=-1) # xywhr i = nms_rotated(boxes, scores, iou_thres) else: boxes = x[:, :4] + c # boxes (offset by class)