From 65abb1c82ff23fdda4f4c0a3079ecc194cfa1345 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 30 Jul 2019 15:58:10 +0200 Subject: [PATCH] updates --- utils/datasets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index d666f9d5..09295fdc 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -157,7 +157,8 @@ class LoadImagesAndLabels(Dataset): # for training/testing def __init__(self, path, img_size=416, batch_size=16, augment=False, hyp=None, rect=False, image_weights=False): path = str(Path(path)) # os-agnostic with open(path, 'r') as f: - self.img_files = [x for x in f.read().splitlines() if os.path.splitext(x)[-1].lower() in img_formats] + self.img_files = [x.replace('/', os.sep) for x in f.read().splitlines() # os-agnostic + if os.path.splitext(x)[-1].lower() in img_formats] n = len(self.img_files) bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index @@ -214,9 +215,8 @@ class LoadImagesAndLabels(Dataset): # for training/testing preload_labels = False if preload_labels: self.labels = [np.zeros((0, 5))] * n - iter = tqdm(self.label_files, desc='Reading labels') if n > 10 else self.label_files extract_bounding_boxes = False - for i, file in enumerate(iter): + for i, file in enumerate(tqdm(self.label_files, desc='Reading labels') if n > 10 else self.label_files): try: with open(file, 'r') as f: l = np.array([x.split() for x in f.read().splitlines()], dtype=np.float32)