def size_similarity(heights, index1, index2):
    """
    Calculate vertical size similarity ratio.

    Args:
        heights(numpy.array): Text proposlas heights.
        index1(int): First text proposal.
        index2(int): Second text proposal.

    Return:
        overlap(float32): vertical overlap.
    """
    h1 = heights[index1]
    h2 = heights[index2]
    return min(h1, h2) / max(h1, h2)