Spaces:
Runtime error
Runtime error
thinh-huynh-re
commited on
Merge branch 'main' of https://huggingface.co/spaces/HiepPhuocSS/TimeSFormer
Browse files- run_opencv.py +1 -1
- utils/frame_rate.py +1 -0
run_opencv.py
CHANGED
@@ -85,7 +85,7 @@ num_skips = 0
|
|
85 |
# define a video capture object
|
86 |
vid = cv2.VideoCapture(0)
|
87 |
|
88 |
-
while
|
89 |
# Capture the video frame
|
90 |
# by frame
|
91 |
ret, frame = vid.read()
|
|
|
85 |
# define a video capture object
|
86 |
vid = cv2.VideoCapture(0)
|
87 |
|
88 |
+
while vid.isOpened():
|
89 |
# Capture the video frame
|
90 |
# by frame
|
91 |
ret, frame = vid.read()
|
utils/frame_rate.py
CHANGED
@@ -12,6 +12,7 @@ class FrameRate:
|
|
12 |
self.NO_FRAMES = 10
|
13 |
self.fps: float = -1
|
14 |
self.label: str = ""
|
|
|
15 |
|
16 |
def reset(self) -> None:
|
17 |
self.start_time = time.time()
|
|
|
12 |
self.NO_FRAMES = 10
|
13 |
self.fps: float = -1
|
14 |
self.label: str = ""
|
15 |
+
self.reset()
|
16 |
|
17 |
def reset(self) -> None:
|
18 |
self.start_time = time.time()
|