From 68a5f8e2078a853623d17ca6a11bfa2ce3ea4aba Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 6 Aug 2019 11:26:52 +0200 Subject: [PATCH] updates --- utils/datasets.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index a7d265f9..2103e45e 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -214,11 +214,10 @@ class LoadImagesAndLabels(Dataset): # for training/testing # Preload labels (required for weighted CE training) self.imgs = [None] * n self.labels = [None] * n - preload_labels = False - if preload_labels or image_weights: + if augment or image_weights: # cache labels for faster training self.labels = [np.zeros((0, 5))] * n extract_bounding_boxes = False - for i, file in enumerate(tqdm(self.label_files, desc='Reading labels') if n > 10 else self.label_files): + for i, file in enumerate(tqdm(self.label_files, desc='Caching labels')): try: with open(file, 'r') as f: l = np.array([x.split() for x in f.read().splitlines()], dtype=np.float32)