From 1679aacdc7f08b55df0ebf985688e01ec1f2d9b6 Mon Sep 17 00:00:00 2001 From: gggmt <1065504814@qq.com> Date: Thu, 2 Dec 2021 17:57:39 +0800 Subject: [PATCH] Update `LoadImages` `ret_val=False` handling (#5852) Video errors may occur. --- utils/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index f3abfb1..6ce7a81 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -200,7 +200,7 @@ class LoadImages: # Read video self.mode = 'video' ret_val, img0 = self.cap.read() - if not ret_val: + while not ret_val: self.count += 1 self.cap.release() if self.count == self.nf: # last video