From 3f82380e12e005bd094ffe4b0c3e8e0decc7569f Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 2 Apr 2019 15:09:13 +0200 Subject: [PATCH] updates --- utils/datasets.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index 9e808e83..30f37be1 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -26,13 +26,13 @@ class LoadImages: # for inference elif os.path.isfile(path): files = [path] - # self.files = list(filter(lambda x: os.path.splitext(x)[1].lower() in img_formats, files)) images = [x for x in files if os.path.splitext(x)[-1].lower() in img_formats] videos = [x for x in files if os.path.splitext(x)[-1].lower() in vid_formats] + nI, nV = len(images), len(videos) + self.files = images + videos - self.nI, self.nV = len(images), len(videos) - self.nF = self.nI + self.nV # number of files - self.video_flag = [False] * self.nI + [True] * self.nV + self.nF = nI + nV # number of files + self.video_flag = [False] * nI + [True] * nV self.mode = 'images' if any(videos): self.new_video(videos[0]) # new video @@ -50,6 +50,7 @@ class LoadImages: # for inference path = self.files[self.count] if self.video_flag[self.count]: + # Read video self.mode = 'video' ret_val, img0 = self.cap.read() if not ret_val: