(boxes1, boxes2, add1=False)
return intersect / union
Computes pairwise intersection-over-union between box collections.

    Args:
        boxes1: a numpy array with shape [N, 4] holding N boxes.
        boxes2: a numpy array with shape [M, 4] holding N boxes.

    Returns:
        a numpy array with shape [N, M] representing pairwise iou scores.
Computes pairwise intersection-over-union between box collections.
Computes pairwise intersection - over - union between box collections .
def iou(boxes1, boxes2, add1=False):
    """Computes pairwise intersection-over-union between box collections.

    Args:
        boxes1: a numpy array with shape [N, 4] holding N boxes.
        boxes2: a numpy array with shape [M, 4] holding N boxes.

    Returns:
        a numpy array with shape [N, M] representing pairwise iou scores.
    """
    intersect = intersection(boxes1, boxes2, add1)
    area1 = area(boxes1, add1)
    area2 = area(boxes2, add1)
    union = np.expand_dims(
        area1, axis=1) + np.expand_dims(
            area2, axis=0) - intersect
    return intersect / union
def iou ( boxes1 , boxes2 , add1 = False ) : intersect = intersection ( boxes1 , boxes2 , add1 ) area1 = area ( boxes1 , add1 ) area2 = area ( boxes2 , add1 ) union = np . expand_dims ( area1 , axis = 1 ) + np . expand_dims ( area2 , axis = 0 ) - intersect return intersect / union