Skip to content

Commit

Permalink
self.label_files bug fix (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Sep 13, 2020
1 parent 6062bb7 commit 806e75f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def __init__(self, path, img_size=640, batch_size=16, augment=False, hyp=None, r

# Define labels
sa, sb = os.sep + 'images' + os.sep, os.sep + 'labels' + os.sep # /images/, /labels/ substrings
self.label_files = [sb.join(x.rsplit(sa, 1)).replace(os.path.splitext(x)[-1], '.txt') for x in self.img_files]
self.label_files = [x.replace(sa, sb, 1).replace(os.path.splitext(x)[-1], '.txt') for x in self.img_files]

# Check cache
cache_path = str(Path(self.label_files[0]).parent) + '.cache' # cached labels
Expand Down

0 comments on commit 806e75f

Please sign in to comment.