Update `LoadImages` `ret_val=False` handling ()

Video errors may occur.
pull/5856/head
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
1 changed files with 1 additions and 1 deletions

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