glenn-jocher commited on
Commit
86e6add
1 Parent(s): 75bbaa8

Remove streaming source sleep period (#8243)

Browse files

Negatively impacts YouTube inference but removes any lag on webcams/RTSP/RTMP etc.

Resolves https://github.com/ultralytics/yolov5/issues/4465

Files changed (1) hide show
  1. utils/dataloaders.py +1 -1
utils/dataloaders.py CHANGED
@@ -359,7 +359,7 @@ class LoadStreams:
359
  LOGGER.warning('WARNING: Video stream unresponsive, please check your IP camera connection.')
360
  self.imgs[i] = np.zeros_like(self.imgs[i])
361
  cap.open(stream) # re-open stream if signal was lost
362
- time.sleep(1 / self.fps[i]) # wait time
363
 
364
  def __iter__(self):
365
  self.count = -1
 
359
  LOGGER.warning('WARNING: Video stream unresponsive, please check your IP camera connection.')
360
  self.imgs[i] = np.zeros_like(self.imgs[i])
361
  cap.open(stream) # re-open stream if signal was lost
362
+ time.sleep(0.0) # wait time
363
 
364
  def __iter__(self):
365
  self.count = -1