Browse Source

Update datasets.py (#3216)

modifyDataloader
Glenn Jocher GitHub 3 years ago
parent
commit
13a1c72699
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      utils/datasets.py

+ 1
- 1
utils/datasets.py View File

@@ -284,7 +284,7 @@ class LoadStreams: # multiple IP or RTSP cameras
assert cap.isOpened(), f'Failed to open {s}'
w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
self.fps = cap.get(cv2.CAP_PROP_FPS) % 100
self.fps = (cap.get(cv2.CAP_PROP_FPS) % 100) or 30.0 # assume 30 FPS if cap gets 0 FPS
self.frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))

_, self.imgs[i] = cap.read() # guarantee first frame

Loading…
Cancel
Save