Skip to content

Commit

Permalink
f.read().strip()
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Nov 29, 2020
1 parent 96a8446 commit 9fa7f9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def __init__(self, sources='streams.txt', img_size=640):

if os.path.isfile(sources):
with open(sources, 'r') as f:
sources = [x.strip() for x in f.read().splitlines() if len(x.strip())]
sources = [x.strip() for x in f.read().strip().splitlines() if len(x.strip())]
else:
sources = [sources]

Expand Down Expand Up @@ -353,7 +353,7 @@ def __init__(self, path, img_size=640, batch_size=16, augment=False, hyp=None, r
f += glob.glob(str(p / '**' / '*.*'), recursive=True)
elif p.is_file(): # file
with open(p, 'r') as t:
t = t.read().splitlines()
t = t.read().strip().splitlines()
parent = str(p.parent) + os.sep
f += [x.replace('./', parent) if x.startswith('./') else x for x in t] # local to global path
else:
Expand Down

0 comments on commit 9fa7f9f

Please sign in to comment.