Update LoadImages ret_val=False handling (#5852)

Video errors may occur.
This commit is contained in:
gggmt 2021-12-02 17:57:39 +08:00 committed by GitHub
parent e8f8f2b903
commit 1679aacdc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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