瀏覽代碼

Update cache comments (#8414)

* Update cache comments

For better readability

* Update dataloaders.py
modifyDataloader
Glenn Jocher GitHub 2 年之前
父節點
當前提交
898332433a
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. +3
    -3
      utils/dataloaders.py

+ 3
- 3
utils/dataloaders.py 查看文件

@@ -449,10 +449,10 @@ class LoadImagesAndLabels(Dataset):
cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache')
try:
cache, exists = np.load(cache_path, allow_pickle=True).item(), True # load dict
assert cache['version'] == self.cache_version # same version
assert cache['hash'] == get_hash(self.label_files + self.im_files) # same hash
assert cache['version'] == self.cache_version # matches current version
assert cache['hash'] == get_hash(self.label_files + self.im_files) # identical hash
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
nf, nm, ne, nc, n = cache.pop('results') # found, missing, empty, corrupt, total

Loading…
取消
儲存