We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7dabe49 commit 2055574Copy full SHA for 2055574
tensorlayerx/vision/transforms/utils.py
@@ -92,10 +92,16 @@ def load_images(path, n_threads = 10):
92
'''
93
images = []
94
files = sorted(os.listdir(path))
95
- for file in range(0, len(files), n_threads):
96
- image_list = files[file:file + n_threads]
97
- image = threading_data(image_list, fn=load_image, path = path)
98
- images.extend(image)
+ if n_threads == 0:
+ for file in files:
+ file = os.path.join(path, file)
+ image = load_image(file)
99
+ images.append(image)
100
+ else:
101
+ for file in range(0, len(files), n_threads):
102
+ image_list = files[file:file + n_threads]
103
+ image = threading_data(image_list, fn=load_image, path = path)
104
+ images.extend(image)
105
return images
106
107
0 commit comments