From c9abc2e23970ea627b87f5c216df0b581ae0bf4b Mon Sep 17 00:00:00 2001 From: masoodazhar Date: Fri, 11 Jun 2021 11:44:56 -0700 Subject: [PATCH 1/2] 'changes-in_dataset' --- utils/datasets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index 444b3ff2f60c..06c7328c4dff 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -137,7 +137,10 @@ def __init__(self, path, img_size=640, stride=32): else: raise Exception(f'ERROR: {p} does not exist') - images = [x for x in files if x.split('.')[-1].lower() in img_formats] + # if the forlder contains zero size of images then it ignore them to be load in images + # and cv2.imread(x) is not None + + images = [x for x in files if x.split('.')[-1].lower() in img_formats and cv2.imread(x) is not None] videos = [x for x in files if x.split('.')[-1].lower() in vid_formats] ni, nv = len(images), len(videos) From 998b6262428af9b0dbcc27b96f132923cb42ce1a Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 14 Jun 2021 12:27:49 +0200 Subject: [PATCH 2/2] Update datasets.py --- utils/datasets.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index 06c7328c4dff..444b3ff2f60c 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -137,10 +137,7 @@ def __init__(self, path, img_size=640, stride=32): else: raise Exception(f'ERROR: {p} does not exist') - # if the forlder contains zero size of images then it ignore them to be load in images - # and cv2.imread(x) is not None - - images = [x for x in files if x.split('.')[-1].lower() in img_formats and cv2.imread(x) is not None] + images = [x for x in files if x.split('.')[-1].lower() in img_formats] videos = [x for x in files if x.split('.')[-1].lower() in vid_formats] ni, nv = len(images), len(videos)