diff --git a/run.py b/run.py index e338779..0bdbd6a 100644 --- a/run.py +++ b/run.py @@ -8,6 +8,7 @@ parser = argparse.ArgumentParser(description='YOLO v2 Bounding Box Tool') parser.add_argument('--format', default='yolo', type=str, choices=['yolo', 'voc'], help="Bounding box format") +parser.add_argument('--sort', action='store_true', help="If true, shows images in order.") args = parser.parse_args() class_index = 0 @@ -283,6 +284,10 @@ def draw_info_bb_selected(tmp_img): image_list = glob.glob(img_dir +'*.jpg') image_list.extend(glob.glob(img_dir + '*.jpeg')) #print(image_list) +image_list.sort() +if not args.sort: + np.random.seed(123) # Keep random img order consistent + np.random.shuffle(image_list) last_img_index = len(image_list) - 1 # load class list