Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update datasets.py #3591

Merged
merged 2 commits into from
Jun 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down