Skip to content

Commit

Permalink
Remove streaming source sleep period (ultralytics#8243)
Browse files Browse the repository at this point in the history
Negatively impacts YouTube inference but removes any lag on webcams/RTSP/RTMP etc.

Resolves ultralytics#4465
  • Loading branch information
glenn-jocher authored Jun 17, 2022
1 parent 75bbaa8 commit 86e6add
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/dataloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def update(self, i, cap, stream):
LOGGER.warning('WARNING: Video stream unresponsive, please check your IP camera connection.')
self.imgs[i] = np.zeros_like(self.imgs[i])
cap.open(stream) # re-open stream if signal was lost
time.sleep(1 / self.fps[i]) # wait time
time.sleep(0.0) # wait time

def __iter__(self):
self.count = -1
Expand Down

0 comments on commit 86e6add

Please sign in to comment.