mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Follow links during dataset scanning
This commit is contained in:
parent
392595c7eb
commit
7cae7e7035
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user