← back

Autoregressive Video Chunk FPS Calculator

#454 · Computer Vision · Easy

⊣ Solve on deep-ml.com

Problem

Calculate the effective frames-per-second for an autoregressive video generation model that produces video in chunks. Given the chunk size (number of frames per generation step), the overlap between consecutive chunks, and the time to generate one chunk, compute the effective FPS of new (non-overlapping) frames.

Solution

1
2
3
4
5
6
7
8
def autoregressive_video_fps(
    chunk_frames: int,
    overlap_frames: int,
    chunk_gen_time_sec: float
) -> float:
    new_frames = chunk_frames - overlap_frames
    fps = new_frames / chunk_gen_time_sec
    return round(fps, 4)

Explanation

  1. Each chunk produces chunk_frames total frames, but the first overlap_frames are shared with the previous chunk for temporal consistency.
  2. The number of genuinely new frames per chunk is chunk_frames - overlap_frames.
  3. Dividing new frames by the generation time for one chunk gives the effective FPS.

Complexity

  • Time: O(1)
  • Space: O(1)