mirror of
https://github.com/ultralytics/yolov5.git
synced 2025-06-03 14:49:29 +08:00
Update LoadImages
ret_val=False
handling (#5852)
Video errors may occur.
This commit is contained in:
parent
e8f8f2b903
commit
1679aacdc7
@ -200,7 +200,7 @@ class LoadImages:
|
|||||||
# Read video
|
# Read video
|
||||||
self.mode = 'video'
|
self.mode = 'video'
|
||||||
ret_val, img0 = self.cap.read()
|
ret_val, img0 = self.cap.read()
|
||||||
if not ret_val:
|
while not ret_val:
|
||||||
self.count += 1
|
self.count += 1
|
||||||
self.cap.release()
|
self.cap.release()
|
||||||
if self.count == self.nf: # last video
|
if self.count == self.nf: # last video
|
||||||
|
Loading…
x
Reference in New Issue
Block a user