Skip to content

Commit

Permalink
Fix bug in subsample.py. Thank you to @Guangyun-Xu for finding this bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcharatan committed Jun 11, 2024
1 parent 19ac72b commit 8bd8d33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flowmap/subsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def video_to_frames(
"""Convert a full video to frames using ffmpeg."""
out_path.mkdir(exist_ok=True, parents=True)
limit = None if limit_num_seconds is None else f"-t {limit_num_seconds}"
command = f"ffmpeg -i {in_path} {limit} {out_path}/frame_%06d.jpg"
command = f"ffmpeg -i {in_path} {limit} {out_path}/frame_%06d.png"
if subprocess.run(command.split(" ")).returncode != 0:
raise ValueError("ffmpeg conversion failed")

Expand Down Expand Up @@ -128,6 +128,7 @@ def subsample_frames(

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

flow_step = sum(mean_flows) / target_num_frames
remaining = 0
Expand Down

0 comments on commit 8bd8d33

Please sign in to comment.