Skip to content

Commit d65537a

Browse files
perf: add break in loop
1 parent 20f386b commit d65537a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

trainer/app_code/yolov5/utils/dataloaders.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,10 @@ def __getitem__(self, index):
762762
for pair in self.flip_label_pairs:
763763
if label[0] == pair[0]:
764764
label[0] = pair[1]
765-
elif label[0] == pair[1]:
765+
break
766+
if label[0] == pair[1]:
766767
label[0] = pair[0]
768+
break
767769

768770
# Cutouts
769771
# labels = cutout(img, labels, p=0.5)

0 commit comments

Comments
 (0)