def overlaps_v(text_proposals, index1, index2):
    """
    Calculate vertical overlap ratio.

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

    Return:
        overlap(float32): vertical overlap.
    """
    h1 = text_proposals[index1][3] - text_proposals[index1][1] + 1
    h2 = text_proposals[index2][3] - text_proposals[index2][1] + 1
    y0 = max(text_proposals[index2][1], text_proposals[index1][1])
    y1 = min(text_proposals[index2][3], text_proposals[index1][3])
    return max(0, y1 - y0 + 1) / min(h1, h2)