Team Ai
Apppublic

dizolivemint/motion-encoder-decoder

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
normalize_interpolate.py17 linesDownload Raw Back to utils
1def normalize_interpolate(ramp_start, ramp_end, normalized):2    """3    Get the interpolated (x, y) along a ramp given a normalized value [0.0, 1.0].4 5    Args:6        ramp_start (tuple): (x0, y0)7        ramp_end (tuple): (x1, y1)8        normalized (float): 0.0 (start) to 1.0 (end) position along the ramp9 10    Returns:11        (x, y): interpolated pixel coordinates12    """13    dx = ramp_end[0] - ramp_start[0]14    dy = ramp_end[1] - ramp_start[1]15    x = ramp_start[0] + normalized * dx16    y = ramp_start[1] + normalized * dy17    return (x, y)