ultralytics 8.0.41 TF SavedModel and EdgeTPU export (#1034)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Noobtoss <96134731+Noobtoss@users.noreply.github.com>
Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
This commit is contained in:
Glenn Jocher
2023-02-20 01:27:28 +01:00
committed by GitHub
parent 4b866c9718
commit f6e393c1d2
64 changed files with 604 additions and 351 deletions

View File

@ -22,7 +22,7 @@ class ClassificationPredictor(BasePredictor):
results = []
for i, pred in enumerate(preds):
orig_img = orig_img[i] if isinstance(orig_img, list) else orig_img
results.append(Results(probs=pred.softmax(0), orig_img=orig_img, names=self.model.names))
results.append(Results(probs=pred, orig_img=orig_img, names=self.model.names))
return results

View File

@ -30,6 +30,9 @@ class ClassificationValidator(BaseValidator):
self.pred.append(preds.argsort(1, descending=True)[:, :5])
self.targets.append(batch['cls'])
def finalize_metrics(self, *args, **kwargs):
self.metrics.speed = dict(zip(self.metrics.speed.keys(), self.speed))
def get_stats(self):
self.metrics.process(self.targets, self.pred)
return self.metrics.results_dict