mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-24 06:14:55 +08:00
Fix OBB xywh-angle concatenation bug (#7404)
This commit is contained in:
parent
ebf8dc0558
commit
e19398a537
@ -61,7 +61,7 @@ class OBBValidator(DetectionValidator):
|
|||||||
Returns:
|
Returns:
|
||||||
(torch.Tensor): Correct prediction matrix of shape [N, 10] for 10 IoU levels.
|
(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)
|
return self.match_predictions(detections[:, 5], gt_cls, iou)
|
||||||
|
|
||||||
def _prepare_batch(self, si, batch):
|
def _prepare_batch(self, si, batch):
|
||||||
|
@ -263,7 +263,7 @@ def non_max_suppression(
|
|||||||
c = x[:, 5:6] * (0 if agnostic else max_wh) # classes
|
c = x[:, 5:6] * (0 if agnostic else max_wh) # classes
|
||||||
scores = x[:, 4] # scores
|
scores = x[:, 4] # scores
|
||||||
if rotated:
|
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)
|
i = nms_rotated(boxes, scores, iou_thres)
|
||||||
else:
|
else:
|
||||||
boxes = x[:, :4] + c # boxes (offset by class)
|
boxes = x[:, :4] + c # boxes (offset by class)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user