From 4879fd22e94c12cea4e74d3f70eb851ef38bbf68 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 22 May 2020 16:03:08 -0700 Subject: [PATCH] caching introspection update --- utils/datasets.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index 6da5eff8..d5f3773a 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -322,13 +322,15 @@ class LoadImagesAndLabels(Dataset): # for training/testing nm, nf, ne, ns, nd = 0, 0, 0, 0, 0 # number missing, found, empty, datasubset, duplicate np_labels_path = str(Path(self.label_files[0]).parent) + '.npy' # saved labels in *.npy file if os.path.isfile(np_labels_path): - print('Loading labels from %s' % np_labels_path) + s = np_labels_path x = list(np.load(np_labels_path, allow_pickle=True)) if len(x) == n: self.labels = x labels_loaded = True + else: + s = path.replace('images', 'labels') - pbar = tqdm(self.label_files, desc='Caching labels') + pbar = tqdm(self.label_files) for i, file in enumerate(pbar): if labels_loaded: l = self.labels[i]