ultralytics 8.0.43 optimized Results class and fixes (#1069)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alexander Duda <Alexander.Duda@me.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-02-21 20:37:59 +01:00 committed by GitHub
parent f2a7a29e53
commit fe61018975
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 180 additions and 102 deletions

View file

@ -243,6 +243,8 @@ class BaseTrainer:
metric_keys = self.validator.metrics.keys + self.label_loss_items(prefix='val')
self.metrics = dict(zip(metric_keys, [0] * len(metric_keys))) # TODO: init metrics for plot_results()?
self.ema = ModelEMA(self.model)
if self.args.plots:
self.plot_training_labels()
self.resume_training(ckpt)
self.scheduler.last_epoch = self.start_epoch - 1 # do not move
self.run_callbacks('on_pretrain_routine_end')
@ -501,6 +503,9 @@ class BaseTrainer:
def plot_training_samples(self, batch, ni):
pass
def plot_training_labels(self):
pass
def save_metrics(self, metrics):
keys, vals = list(metrics.keys()), list(metrics.values())
n = len(metrics) + 1 # number of cols