Spaces:
Runtime error
Runtime error
sradc
commited on
Commit
•
5a9c0da
1
Parent(s):
b4233e1
fix timestamp computation (was rounding fps to int...)
Browse files
pipeline/process_videos.py
CHANGED
@@ -55,8 +55,8 @@ def process_videos() -> None:
|
|
55 |
def get_clip_vectors(video_path, clip_wrapper):
|
56 |
cap = cv2.VideoCapture(str(video_path))
|
57 |
num_video_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
|
58 |
-
fps =
|
59 |
-
extract_every_n_frames = FRAME_EXTRACT_RATE_SECONDS * fps
|
60 |
for frame_idx in tqdm(range(num_video_frames), desc="Running CLIP on video"):
|
61 |
ret, frame = cap.read()
|
62 |
if frame_idx % extract_every_n_frames != 0:
|
|
|
55 |
def get_clip_vectors(video_path, clip_wrapper):
|
56 |
cap = cv2.VideoCapture(str(video_path))
|
57 |
num_video_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
|
58 |
+
fps = cap.get(cv2.CAP_PROP_FPS)
|
59 |
+
extract_every_n_frames = int(FRAME_EXTRACT_RATE_SECONDS * fps)
|
60 |
for frame_idx in tqdm(range(num_video_frames), desc="Running CLIP on video"):
|
61 |
ret, frame = cap.read()
|
62 |
if frame_idx % extract_every_n_frames != 0:
|