ultralytics 8.0.78 Docker and confusion matrix updates (#2035)

Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Abdul Manaf <75582860+AbdulManaf12@users.noreply.github.com>
This commit is contained in:
Glenn Jocher
2023-04-15 00:59:18 +02:00
committed by GitHub
parent 2c6fc0a444
commit 5c35dba22a
8 changed files with 43 additions and 34 deletions

View File

@ -12,7 +12,6 @@ class ClassificationValidator(BaseValidator):
super().__init__(dataloader, save_dir, pbar, args, _callbacks)
self.args.task = 'classify'
self.metrics = ClassifyMetrics()
self.save_dir = save_dir
def get_desc(self):
return ('%22s' + '%11s' * 2) % ('classes', 'top1_acc', 'top5_acc')
@ -37,6 +36,8 @@ class ClassificationValidator(BaseValidator):
def finalize_metrics(self, *args, **kwargs):
self.confusion_matrix.process_cls_preds(self.pred, self.targets)
if self.args.plots:
self.confusion_matrix.plot(save_dir=self.save_dir, names=list(self.names.values()))
self.metrics.speed = self.speed
self.metrics.confusion_matrix = self.confusion_matrix
@ -55,8 +56,6 @@ class ClassificationValidator(BaseValidator):
def print_results(self):
pf = '%22s' + '%11.3g' * len(self.metrics.keys) # print format
LOGGER.info(pf % ('all', self.metrics.top1, self.metrics.top5))
if self.args.plots:
self.confusion_matrix.plot(save_dir=self.save_dir, names=list(self.names.values()))
def val(cfg=DEFAULT_CFG, use_python=False):