CoreML NMS and half fixes (#143)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-01-05 00:20:54 +01:00 committed by GitHub
parent 55bdca6768
commit 172cef2d20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 95 additions and 414 deletions

View file

@ -157,7 +157,8 @@ class BaseValidator:
self.run_callbacks('on_val_end')
if self.training:
model.float()
return {**stats, **trainer.label_loss_items(self.loss.cpu() / len(self.dataloader), prefix="val")}
results = {**stats, **trainer.label_loss_items(self.loss.cpu() / len(self.dataloader), prefix="val")}
return {k: round(float(v), 5) for k, v in results.items()} # return results as 5 decimal place floats
else:
self.logger.info('Speed: %.1fms pre-process, %.1fms inference, %.1fms loss, %.1fms post-process per image' %
self.speed)