Skip to content

Commit 25d1f29

Browse files
authored
Plot AutoShape() detections in ascending order (PaddlePaddle#3843)
1 parent 7d6af69 commit 25d1f29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def display(self, pprint=False, show=False, save=False, crop=False, render=False
311311
n = (pred[:, -1] == c).sum() # detections per class
312312
str += f"{n} {self.names[int(c)]}{'s' * (n > 1)}, " # add to string
313313
if show or save or render or crop:
314-
for *box, conf, cls in pred: # xyxy, confidence, class
314+
for *box, conf, cls in reversed(pred): # xyxy, confidence, class
315315
label = f'{self.names[int(cls)]} {conf:.2f}'
316316
if crop:
317317
save_one_box(box, im, file=save_dir / 'crops' / self.names[int(cls)] / self.files[i])

0 commit comments

Comments
 (0)