Update LoadImages ret_val=False handling (#5852)

Video errors may occur.
This commit is contained in:
gggmt authored and GitHub committed 2021-12-02 10:57:39 +01:00
1 parent e8f8f2b903
commit 1679aacdc7
1 file changed
+1 -1
+1 -1
View File
@@ -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