Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LoadStreams() dataloader frame skip issue #3833

Merged
merged 2 commits into from
Jun 30, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update datasets.py to read every 4th frame of streams
  • Loading branch information
feras-oughali authored Jun 30, 2021
commit 099d7fda71d22176dfa04f79733feecc12360619
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def update(self, i, cap):
n += 1
# _, self.imgs[index] = cap.read()
cap.grab()
if n % 4: # read every 4th frame
if n % 4 == 0: # read every 4th frame
success, im = cap.retrieve()
self.imgs[i] = im if success else self.imgs[i] * 0
time.sleep(1 / self.fps[i]) # wait time
Expand Down