Unverified 提交 25d1f293 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Plot `AutoShape()` detections in ascending order (#3843)

上级 7d6af696
...@@ -311,7 +311,7 @@ class Detections: ...@@ -311,7 +311,7 @@ class Detections:
n = (pred[:, -1] == c).sum() # detections per class n = (pred[:, -1] == c).sum() # detections per class
str += f"{n} {self.names[int(c)]}{'s' * (n > 1)}, " # add to string str += f"{n} {self.names[int(c)]}{'s' * (n > 1)}, " # add to string
if show or save or render or crop: if show or save or render or crop:
for *box, conf, cls in pred: # xyxy, confidence, class for *box, conf, cls in reversed(pred): # xyxy, confidence, class
label = f'{self.names[int(cls)]} {conf:.2f}' label = f'{self.names[int(cls)]} {conf:.2f}'
if crop: if crop:
save_one_box(box, im, file=save_dir / 'crops' / self.names[int(cls)] / self.files[i]) save_one_box(box, im, file=save_dir / 'crops' / self.names[int(cls)] / self.files[i])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论