Fix LoadStreams missing frame bug (#4913)

This commit is contained in:
Glenn Jocher 2023-09-15 02:35:22 +02:00 committed by GitHub
parent daf16ecf31
commit c8de4fe634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: