Commit 40fdf71d authored by Gabriel Bianconi's avatar Gabriel Bianconi Committed by Soumith Chintala
Browse files

Sort images while creating dataset in ImageFolder (#218)

parent 85bb16a8
......@@ -30,7 +30,7 @@ def make_dataset(dir, class_to_idx):
continue
for root, _, fnames in sorted(os.walk(d)):
for fname in fnames:
for fname in sorted(fnames):
if is_image_file(fname):
path = os.path.join(root, fname)
item = (path, class_to_idx[target])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment