def intersection_over_box(chips, boxes):
    """
    intersection area over box area
    :param chips:  C
    :param boxes:  B
    :return: iob, CxB
    """
    M = chips.shape[0]
    N = boxes.shape[0]
    if M * N == 0:
        return np.zeros([M, N], dtype='float32')

    box_area = bbox_area(boxes)  # B

    inter_x2y2 = np.minimum(np.expand_dims(chips, 1)[:, :, 2:],
                            boxes[:, 2:])  # CxBX2
    inter_x1y1 = np.maximum(np.expand_dims(chips, 1)[:, :, :2],
                            boxes[:, :2])  # CxBx2
    inter_wh = inter_x2y2 - inter_x1y1
    inter_wh = np.clip(inter_wh, a_min=0, a_max=None)
    inter_area = inter_wh[:, :, 0] * inter_wh[:, :, 1]  # CxB

    iob = inter_area / np.expand_dims(box_area, 0)
    return iob

    intersection area over box area
    :param chips:  C
    :param boxes:  B
    :return: iob, CxB
    
ppdet/data/crop_utils/chip_box_utils.py