mirror of
https://github.com/ultralytics/yolov5.git
synced 2025-06-03 14:49:29 +08:00
Update cache comments (#8414)
* Update cache comments For better readability * Update dataloaders.py
This commit is contained in:
parent
e50dc38d36
commit
898332433a
@ -449,10 +449,10 @@ class LoadImagesAndLabels(Dataset):
|
|||||||
cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache')
|
cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache')
|
||||||
try:
|
try:
|
||||||
cache, exists = np.load(cache_path, allow_pickle=True).item(), True # load dict
|
cache, exists = np.load(cache_path, allow_pickle=True).item(), True # load dict
|
||||||
assert cache['version'] == self.cache_version # same version
|
assert cache['version'] == self.cache_version # matches current version
|
||||||
assert cache['hash'] == get_hash(self.label_files + self.im_files) # same hash
|
assert cache['hash'] == get_hash(self.label_files + self.im_files) # identical hash
|
||||||
except Exception:
|
except Exception:
|
||||||
cache, exists = self.cache_labels(cache_path, prefix), False # cache
|
cache, exists = self.cache_labels(cache_path, prefix), False # run cache ops
|
||||||
|
|
||||||
# Display cache
|
# Display cache
|
||||||
nf, nm, ne, nc, n = cache.pop('results') # found, missing, empty, corrupt, total
|
nf, nm, ne, nc, n = cache.pop('results') # found, missing, empty, corrupt, total
|
||||||
|
Loading…
x
Reference in New Issue
Block a user