Display Val images per class (#12645)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Adamcode 2024-05-29 23:02:41 +08:00 committed by GitHub
parent b95b583237
commit 7cd871dbd0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 8 deletions

View file

@ -51,7 +51,7 @@ class SegmentationValidator(DetectionValidator):
self.process = ops.process_mask_upsample # more accurate
else:
self.process = ops.process_mask # faster
self.stats = dict(tp_m=[], tp=[], conf=[], pred_cls=[], target_cls=[])
self.stats = dict(tp_m=[], tp=[], conf=[], pred_cls=[], target_cls=[], target_img=[])
def get_desc(self):
"""Return a formatted description of evaluation metrics."""
@ -112,6 +112,7 @@ class SegmentationValidator(DetectionValidator):
cls, bbox = pbatch.pop("cls"), pbatch.pop("bbox")
nl = len(cls)
stat["target_cls"] = cls
stat["target_img"] = cls.unique()
if npr == 0:
if nl:
for k in self.stats.keys():