Apply ruff==0.9.0 formatting (#18624)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
c196a82bfa
commit
34b339d033
12 changed files with 17 additions and 30 deletions
|
|
@ -652,12 +652,11 @@ class Results(SimpleClass):
|
|||
"""
|
||||
log_string = ""
|
||||
probs = self.probs
|
||||
boxes = self.boxes
|
||||
if len(self) == 0:
|
||||
return log_string if probs is not None else f"{log_string}(no detections), "
|
||||
if probs is not None:
|
||||
log_string += f"{', '.join(f'{self.names[j]} {probs.data[j]:.2f}' for j in probs.top5)}, "
|
||||
if boxes:
|
||||
if boxes := self.boxes:
|
||||
for c in boxes.cls.unique():
|
||||
n = (boxes.cls == c).sum() # detections per class
|
||||
log_string += f"{n} {self.names[int(c)]}{'s' * (n > 1)}, "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue