glenn-jocher
commited on
Commit
•
d6f6b33
1
Parent(s):
01a67a9
update datasets.py for image size check during caching
Browse files- utils/datasets.py +1 -0
utils/datasets.py
CHANGED
@@ -436,6 +436,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
|
436 |
image.verify() # PIL verify
|
437 |
# _ = io.imread(img) # skimage verify (from skimage import io)
|
438 |
shape = exif_size(image) # image size
|
|
|
439 |
if os.path.isfile(label):
|
440 |
with open(label, 'r') as f:
|
441 |
l = np.array([x.split() for x in f.read().splitlines()], dtype=np.float32) # labels
|
|
|
436 |
image.verify() # PIL verify
|
437 |
# _ = io.imread(img) # skimage verify (from skimage import io)
|
438 |
shape = exif_size(image) # image size
|
439 |
+
assert (shape[0] > 9) & (shape[1] > 9), 'image size <10 pixels'
|
440 |
if os.path.isfile(label):
|
441 |
with open(label, 'r') as f:
|
442 |
l = np.array([x.split() for x in f.read().splitlines()], dtype=np.float32) # labels
|