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
22 changed files with 180 additions and 102 deletions

View File

@ -56,7 +56,7 @@ class DetectionPredictor(BasePredictor):
det = results[idx].boxes # TODO: make boxes inherit from tensors
if len(det) == 0:
return log_string
return f'{log_string}(no detections), '
for c in det.cls.unique():
n = (det.cls == c).sum() # detections per class
log_string += f"{n} {self.model.names[int(c)]}{'s' * (n > 1)}, "