diff --git a/detect.py b/detect.py index 6f2fd58..40aa240 100644 --- a/detect.py +++ b/detect.py @@ -100,7 +100,7 @@ def detect(save_img=False): s += '%g %ss, ' % (n, names[int(c)]) # add to string # Write results - for *xyxy, conf, cls in det: + for *xyxy, conf, cls in reversed(det): if save_txt: # Write to file xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4)) / gn).view(-1).tolist() # normalized xywh with open(txt_path + '.txt', 'a') as f: