diff --git a/utils/datasets.py b/utils/datasets.py index ac81603c7d34..4430321661a7 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -200,7 +200,7 @@ def __next__(self): # 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