Recursive directories dataset capability (#1408)

* Recursive directories dataset capability

* x.split('.')[-1]

* f += glob.glob(f"{p}{os.sep}**.*", recursive=True)

* f += glob.glob(str(p / '**.*'), recursive=True)

* remove . from image and vid formats

* .txt to txt

* str(p / '**' / '*.*')
This commit is contained in:
Glenn Jocher authored and GitHub committed 2020-11-16 16:24:57 +01:00
1 parent 9c91aeae10
commit 548a98a391
2 files changed
+15 -16

No files matched your search

+3 -3
View File
@@ -79,9 +79,9 @@ def check_dataset(dict):
# Download dataset if not found locally
val, s = dict.get('val'), dict.get('download')
if val and len(val):
val = [os.path.abspath(x) for x in (val if isinstance(val, list) else [val])] # val path
if not all(os.path.exists(x) for x in val):
print('\nWARNING: Dataset not found, nonexistent paths: %s' % [*val])
val = [Path(x).resolve() for x in (val if isinstance(val, list) else [val])] # val path
if not all(x.exists() for x in val):
print('\nWARNING: Dataset not found, nonexistent paths: %s' % [str(x) for x in val if not x.exists()])
if s and len(s): # download script
print('Downloading %s ...' % s)
if s.startswith('http') and s.endswith('.zip'): # URL