Skip to content

Commit a2c52ba

Browse files
committed
Merge branch 'MattKleinsmith-patch-7'
2 parents 3d4dba7 + 6bbac05 commit a2c52ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

run.py

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
parser = argparse.ArgumentParser(description='YOLO v2 Bounding Box Tool')
1010
parser.add_argument('--format', default='yolo', type=str, choices=['yolo', 'voc'], help="Bounding box format")
11+
parser.add_argument('--sort', action='store_true', help="If true, shows images in order.")
1112
args = parser.parse_args()
1213

1314
class_index = 0
@@ -283,6 +284,10 @@ def draw_info_bb_selected(tmp_img):
283284
image_list = glob.glob(img_dir +'*.jpg')
284285
image_list.extend(glob.glob(img_dir + '*.jpeg'))
285286
#print(image_list)
287+
image_list.sort()
288+
if not args.sort:
289+
np.random.seed(123) # Keep random img order consistent
290+
np.random.shuffle(image_list)
286291
last_img_index = len(image_list) - 1
287292

288293
# load class list

0 commit comments

Comments
 (0)