bug fix in local to global path replacement

This commit is contained in:
Glenn Jocher 2020-05-28 20:50:02 -07:00
parent 2c39dba675
commit cf7a4d31d3
1 changed files with 1 additions and 1 deletions

View File

@ -264,7 +264,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
if os.path.isfile(path): # file
with open(path, 'r') as f:
f = f.read().splitlines()
f = [x.replace('./', parent) for x in f if x.startswith('./')] # local to global path
f = [x.replace('./', parent) if x.startswith('./') else x for x in f] # local to global path
elif os.path.isdir(path): # folder
f = glob.iglob(path + os.sep + '*.*')
else: