Skip to content

Commit

Permalink
fix: keyword arguments for VideoWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
sokovninn committed Oct 1, 2024
1 parent f5305c8 commit de75e09
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions luxonis_train/core/utils/infer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def process_video(
show: bool = False,
) -> None:
"""Handles inference on a video."""
cap = cv2.VideoCapture(str(video_path))
cap = cv2.VideoCapture(filename=str(video_path))
total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
progress_bar = tqdm.tqdm(
total=total_frames, position=0, leave=True, desc="Processing video"
Expand Down Expand Up @@ -101,10 +101,10 @@ def process_video(
for name, viz_arrs in rendered_visualizations.items():
if name not in out_writers:
out_writers[name] = cv2.VideoWriter(
str(save_dir / f"{name.replace('/', '-')}.mp4"),
cv2.VideoWriter_fourcc(*"mp4v"),
cap.get(cv2.CAP_PROP_FPS),
(viz_arrs[0].shape[1], viz_arrs[0].shape[0]),
filename=str(save_dir / f"{name.replace('/', '-')}.mp4"),
fourcc=cv2.VideoWriter_fourcc(*"mp4v"),
fps=cap.get(cv2.CAP_PROP_FPS),
frameSize=(viz_arrs[0].shape[1], viz_arrs[0].shape[0]),
)
for viz_arr in viz_arrs:
out_writers[name].write(viz_arr)
Expand Down

0 comments on commit de75e09

Please sign in to comment.