Skip to content

pipeline_utils

Deterministic math and RNG helpers for Helios pyramid sampling.

Functions:

fastvideo.pipelines.basic.helios.pipeline_utils.calculate_shift

calculate_shift(image_seq_len: int, base_seq_len: int = 256, max_seq_len: int = 4096, base_shift: float = 0.5, max_shift: float = 1.15) -> float

Calculate the dynamic flow shift for a pyramid stage.

Source code in fastvideo/pipelines/basic/helios/pipeline_utils.py
def calculate_shift(
    image_seq_len: int,
    base_seq_len: int = 256,
    max_seq_len: int = 4096,
    base_shift: float = 0.5,
    max_shift: float = 1.15,
) -> float:
    """Calculate the dynamic flow shift for a pyramid stage."""
    slope = (max_shift - base_shift) / (max_seq_len - base_seq_len)
    intercept = base_shift - slope * base_seq_len
    return image_seq_len * slope + intercept