Commit
•
13a1c72
1
Parent(s):
ffb47ff
Update datasets.py (#3216)
Browse files- utils/datasets.py +1 -1
utils/datasets.py
CHANGED
@@ -284,7 +284,7 @@ class LoadStreams: # multiple IP or RTSP cameras
|
|
284 |
assert cap.isOpened(), f'Failed to open {s}'
|
285 |
w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
|
286 |
h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
287 |
-
self.fps = cap.get(cv2.CAP_PROP_FPS) % 100
|
288 |
self.frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
|
289 |
|
290 |
_, self.imgs[i] = cap.read() # guarantee first frame
|
|
|
284 |
assert cap.isOpened(), f'Failed to open {s}'
|
285 |
w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
|
286 |
h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
287 |
+
self.fps = (cap.get(cv2.CAP_PROP_FPS) % 100) or 30.0 # assume 30 FPS if cap gets 0 FPS
|
288 |
self.frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
|
289 |
|
290 |
_, self.imgs[i] = cap.read() # guarantee first frame
|