From 7cae7e7035fde90d65a055a612489fbd9253da1a Mon Sep 17 00:00:00 2001 From: Csaba Kertesz Date: Mon, 4 Jan 2021 00:16:45 +0200 Subject: [PATCH] Follow links during dataset scanning --- timm/data/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/data/dataset.py b/timm/data/dataset.py index 99d99917..7da2941d 100644 --- a/timm/data/dataset.py +++ b/timm/data/dataset.py @@ -26,7 +26,7 @@ def natural_key(string_): def find_images_and_targets(folder, types=IMG_EXTENSIONS, class_to_idx=None, leaf_name_only=True, sort=True): labels = [] filenames = [] - for root, subdirs, files in os.walk(folder, topdown=False): + for root, subdirs, files in os.walk(folder, topdown=False, followlinks=True): rel_path = os.path.relpath(root, folder) if (root != folder) else '' label = os.path.basename(rel_path) if leaf_name_only else rel_path.replace(os.path.sep, '_') for f in files: