From 74d5496b5bc6cf12af4f89db283b8a62365aba6b Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 5 May 2019 21:00:50 +0200 Subject: [PATCH] updates --- utils/datasets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/datasets.py b/utils/datasets.py index bd6ef6a9..c4f93f23 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -155,6 +155,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing if os.path.exists(sp): # read existing shapefile with open(sp, 'r') as f: s = np.array([x.split() for x in f.read().splitlines()], dtype=np.float32) + assert len(s) == n, 'Shapefile out of sync, please delete %s and rerun' % sp else: # no shapefile, so read shape using PIL and write shapefile for next time (faster) s = np.array([Image.open(f).size for f in tqdm(self.img_files, desc='Reading image shapes')]) np.savetxt(sp, s, fmt='%g')