Skip to content

Commit

Permalink
Plot AutoShape() detections in ascending order (#3843)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jun 30, 2021
1 parent 7d6af69 commit 25d1f29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def display(self, pprint=False, show=False, save=False, crop=False, render=False
n = (pred[:, -1] == c).sum() # detections per class
str += f"{n} {self.names[int(c)]}{'s' * (n > 1)}, " # add to string
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}'
if crop:
save_one_box(box, im, file=save_dir / 'crops' / self.names[int(cls)] / self.files[i])
Expand Down

0 comments on commit 25d1f29

Please sign in to comment.