ultralytics 8.1.16 OBB ConfusionMatrix support (#8299)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
42744a1717
commit
de01212465
12 changed files with 26 additions and 20 deletions
|
|
@ -132,8 +132,7 @@ class DetectionValidator(BaseValidator):
|
|||
if nl:
|
||||
for k in self.stats.keys():
|
||||
self.stats[k].append(stat[k])
|
||||
# TODO: obb has not supported confusion_matrix yet.
|
||||
if self.args.plots and self.args.task != "obb":
|
||||
if self.args.plots:
|
||||
self.confusion_matrix.process_batch(detections=None, gt_bboxes=bbox, gt_cls=cls)
|
||||
continue
|
||||
|
||||
|
|
@ -147,8 +146,7 @@ class DetectionValidator(BaseValidator):
|
|||
# Evaluate
|
||||
if nl:
|
||||
stat["tp"] = self._process_batch(predn, bbox, cls)
|
||||
# TODO: obb has not supported confusion_matrix yet.
|
||||
if self.args.plots and self.args.task != "obb":
|
||||
if self.args.plots:
|
||||
self.confusion_matrix.process_batch(predn, bbox, cls)
|
||||
for k in self.stats.keys():
|
||||
self.stats[k].append(stat[k])
|
||||
|
|
|
|||
|
|
@ -55,10 +55,11 @@ class OBBValidator(DetectionValidator):
|
|||
Return correct prediction matrix.
|
||||
|
||||
Args:
|
||||
detections (torch.Tensor): Tensor of shape [N, 6] representing detections.
|
||||
Each detection is of the format: x1, y1, x2, y2, conf, class.
|
||||
labels (torch.Tensor): Tensor of shape [M, 5] representing labels.
|
||||
Each label is of the format: class, x1, y1, x2, y2.
|
||||
detections (torch.Tensor): Tensor of shape [N, 7] representing detections.
|
||||
Each detection is of the format: x1, y1, x2, y2, conf, class, angle.
|
||||
gt_bboxes (torch.Tensor): Tensor of shape [M, 5] representing rotated boxes.
|
||||
Each box is of the format: x1, y1, x2, y2, angle.
|
||||
labels (torch.Tensor): Tensor of shape [M] representing labels.
|
||||
|
||||
Returns:
|
||||
(torch.Tensor): Correct prediction matrix of shape [N, 10] for 10 IoU levels.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue