From 27b75e0d374b471e29ad7d86e4955e7a98c11b17 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 7 Nov 2019 15:49:37 -0800 Subject: [PATCH] updates --- utils/datasets.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/utils/datasets.py b/utils/datasets.py index 8ccccd39..b8dfbadc 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -799,6 +799,15 @@ def convert_images2bmp(): file.write(lines) +def imagelist2folder(path='../data/sm3/out_test.txt'): # from utils.datasets import *; imagelist2folder() + # Copies all the images in a text file (list of images) into a folder + create_folder(path[:-4]) + with open(path, 'r') as f: + for line in f.read().splitlines(): + os.system('cp "%s" %s' % (line, path[:-4])) + print(line) + + def create_folder(path='./new_folder'): # Create folder if os.path.exists(path):