We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19ac72b commit 8bd8d33Copy full SHA for 8bd8d33
1 file changed
flowmap/subsample.py
@@ -75,7 +75,7 @@ def video_to_frames(
75
"""Convert a full video to frames using ffmpeg."""
76
out_path.mkdir(exist_ok=True, parents=True)
77
limit = None if limit_num_seconds is None else f"-t {limit_num_seconds}"
78
- command = f"ffmpeg -i {in_path} {limit} {out_path}/frame_%06d.jpg"
+ command = f"ffmpeg -i {in_path} {limit} {out_path}/frame_%06d.png"
79
if subprocess.run(command.split(" ")).returncode != 0:
80
raise ValueError("ffmpeg conversion failed")
81
@@ -128,6 +128,7 @@ def subsample_frames(
128
129
# Compute the mean flows.
130
mean_flows.append(flow_predictor.forward(videos).norm(dim=-1).mean().item())
131
+ last = current
132
133
flow_step = sum(mean_flows) / target_num_frames
134
remaining = 0
0 commit comments