Fix LoadStreams missing frame bug (#4913)

pull/4914/head
Glenn Jocher 1 year ago committed by GitHub
parent daf16ecf31
commit c8de4fe634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ultralytics/data/loaders.py

@ -127,8 +127,10 @@ class LoadStreams:
if not self.threads[i].is_alive() or cv2.waitKey(1) == ord('q'): # q to quit
self.close()
raise StopIteration
LOGGER.warning(f'WARNING ⚠ Waiting for stream {i}')
time.sleep(1 / min(self.fps))
x = self.imgs[i]
if not x:
LOGGER.warning(f'WARNING ⚠ Waiting for stream {i}')
# Get and remove the first frame from imgs buffer
if self.buffer:

Loading…
Cancel
Save