glenn-jocher commited on
Commit
9fa7f9f
1 Parent(s): 96a8446

f.read().strip()

Browse files
Files changed (1) hide show
  1. utils/datasets.py +2 -2
utils/datasets.py CHANGED
@@ -261,7 +261,7 @@ class LoadStreams: # multiple IP or RTSP cameras
261
 
262
  if os.path.isfile(sources):
263
  with open(sources, 'r') as f:
264
- sources = [x.strip() for x in f.read().splitlines() if len(x.strip())]
265
  else:
266
  sources = [sources]
267
 
@@ -353,7 +353,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
353
  f += glob.glob(str(p / '**' / '*.*'), recursive=True)
354
  elif p.is_file(): # file
355
  with open(p, 'r') as t:
356
- t = t.read().splitlines()
357
  parent = str(p.parent) + os.sep
358
  f += [x.replace('./', parent) if x.startswith('./') else x for x in t] # local to global path
359
  else:
 
261
 
262
  if os.path.isfile(sources):
263
  with open(sources, 'r') as f:
264
+ sources = [x.strip() for x in f.read().strip().splitlines() if len(x.strip())]
265
  else:
266
  sources = [sources]
267
 
 
353
  f += glob.glob(str(p / '**' / '*.*'), recursive=True)
354
  elif p.is_file(): # file
355
  with open(p, 'r') as t:
356
+ t = t.read().strip().splitlines()
357
  parent = str(p.parent) + os.sep
358
  f += [x.replace('./', parent) if x.startswith('./') else x for x in t] # local to global path
359
  else: