def rescale_box(box: Union[List[float], ndarray, FloatTensor], from_size: Tuple, to_size: Tuple) -> List[float]:
    """rescales a bounding box between two different image sizes

    Args:
        box (Union[List[float], ndarray, FloatTensor]): bounding boxes
        from_size (Tuple): the original size 
        to_size (Tuple): the size to rescale to

    Returns:
        Tuple: the rescaled boxes
    """
    Fy = to_size[1]/from_size[1]
    Fx = to_size[0]/from_size[0]

    x1, y1, x2, y2 = box

    x1_n = x1*Fx
    x2_n = x2*Fx

    y1_n = y1*Fy
    y2_n = y2*Fy

    return [x1_n, y1_n, x2_n, y2_n]
rescales a bounding box between two different image sizes

    Args:
        box (Union[List[float], ndarray, FloatTensor]): bounding boxes
        from_size (Tuple): the original size 
        to_size (Tuple): the size to rescale to

    Returns:
        Tuple: the rescaled boxes
    
src/marqo/s2_inference/processing/image_utils.py