Skip to content

Commit 8bd8d33

Browse files
committed
Fix bug in subsample.py. Thank you to @Guangyun-Xu for finding this bug.
1 parent 19ac72b commit 8bd8d33

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

flowmap/subsample.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def video_to_frames(
7575
"""Convert a full video to frames using ffmpeg."""
7676
out_path.mkdir(exist_ok=True, parents=True)
7777
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"
78+
command = f"ffmpeg -i {in_path} {limit} {out_path}/frame_%06d.png"
7979
if subprocess.run(command.split(" ")).returncode != 0:
8080
raise ValueError("ffmpeg conversion failed")
8181

@@ -128,6 +128,7 @@ def subsample_frames(
128128

129129
# Compute the mean flows.
130130
mean_flows.append(flow_predictor.forward(videos).norm(dim=-1).mean().item())
131+
last = current
131132

132133
flow_step = sum(mean_flows) / target_num_frames
133134
remaining = 0

0 commit comments

Comments
 (0)