Skip to content

Commit

Permalink
Update datasets.py
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Feb 5, 2021
1 parent 9e5e9be commit fb32919
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,7 @@ def __init__(self, path, img_size=640, batch_size=16, augment=False, hyp=None, r

# Check cache
self.label_files = img2label_paths(self.img_files) # labels
cache_basename = os.path.basename(os.path.dirname(self.label_files[0]))
new_cache = self.label_files[0].replace(cache_basename, data_type)
cache_path = Path(new_cache).parent.with_suffix('.cache') # cached labels
cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache') # cached labels
if cache_path.is_file():
cache = torch.load(cache_path) # load
if cache['hash'] != get_hash(self.label_files + self.img_files) or 'results' not in cache: # changed
Expand Down

0 comments on commit fb32919

Please sign in to comment.