glenn-jocher commited on
Commit
f9bab6b
·
unverified ·
1 Parent(s): 54a9e4f

Update datasets.py

Browse files
Files changed (1) hide show
  1. utils/datasets.py +1 -6
utils/datasets.py CHANGED
@@ -295,16 +295,11 @@ class LoadImagesAndLabels(Dataset): # for training/testing
295
  else:
296
  raise Exception('%s does not exist' % subpath)
297
  self.img_files = [x.replace('/', os.sep) for x in f if os.path.splitext(x)[-1].lower() in img_formats]
 
298
  except:
299
  # Maybe avoid handling bare exceptions
300
  raise Exception('Error loading data from %s. See %s' % (path, help_url))
301
 
302
- # Still need to do this for compatibility with the .npy and shape file saves
303
- if isinstance(path, list):
304
- path = str(Path(path[0]))
305
- else:
306
- path = str(Path(path))
307
-
308
  n = len(self.img_files)
309
  assert n > 0, 'No images found in %s. See %s' % (path, help_url)
310
  bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index
 
295
  else:
296
  raise Exception('%s does not exist' % subpath)
297
  self.img_files = [x.replace('/', os.sep) for x in f if os.path.splitext(x)[-1].lower() in img_formats]
298
+ path = subpath
299
  except:
300
  # Maybe avoid handling bare exceptions
301
  raise Exception('Error loading data from %s. See %s' % (path, help_url))
302
 
 
 
 
 
 
 
303
  n = len(self.img_files)
304
  assert n > 0, 'No images found in %s. See %s' % (path, help_url)
305
  bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index