def get_lesion_size_ratio(corners, patch_shape):
    """Compute bbox to patch size ratio

    Args:
        corner_resize: tightest bbox coord of lesion (xmin, ymin, xmax, ymax)
        patch_shape: in the order of (y_size, x_size)

    Returns:
        lesion_size_ratio: sqrt(lesion_area / patch_area)
    """
    xmin, ymin, xmax, ymax = corners
    h, w = patch_shape
    lesion_size_ratio = ((xmax - xmin) * (ymax - ymin) / (h * w)) ** 0.5
    return lesion_size_ratio