evaluate/test_ap.py
def compute_bbox_overlaps(boxes1, boxes2):
    """Computes IoU overlaps between two sets of boxes.
    boxes1, boxes2: [N, (y1, x1, y2, x2)].

    For better performance, pass the largest set first and the smaller second.
    """
    # Areas of anchors and GT boxes
    area1 = (boxes1[:, 2] - boxes1[:, 0]) * (boxes1[:, 3] - boxes1[:, 1])
    area2 = (boxes2[:, 2] - boxes2[:, 0]) * (boxes2[:, 3] - boxes2[:, 1])

    # Compute overlaps to generate matrix [boxes1 count, boxes2 count]
    # Each cell contains the IoU value.
    overlaps = np.zeros((boxes1.shape[0], boxes2.shape[0]))
    for i in range(overlaps.shape[1]):#先对gt做处理计算iou
        box2 = boxes2[i]
        overlaps[:, i] = compute_bbox_iou(box2, boxes1, area2[i], area1)#对box_pre的处理在compute_iou函数中进行
    return overlaps
Computes IoU overlaps between two sets of boxes.
    boxes1, boxes2: [N, (y1, x1, y2, x2)].

    For better performance, pass the largest set first and the smaller second.
    
Computes IoU overlaps between two sets of boxes.

For better performance, pass the largest set first and the smaller second.
Computes IoU overlaps between two sets of boxes . For better performance pass the largest set first and the smaller second .
def compute_bbox_overlaps(boxes1, boxes2):
    area1 = (boxes1[:, 2] - boxes1[:, 0]) * (boxes1[:, 3] - boxes1[:, 1])
    area2 = (boxes2[:, 2] - boxes2[:, 0]) * (boxes2[:, 3] - boxes2[:, 1])
    overlaps = np.zeros((boxes1.shape[0], boxes2.shape[0]))
    for i in range(overlaps.shape[1]):
        box2 = boxes2[i]
        overlaps[:, i] = compute_bbox_iou(box2, boxes1, area2[i], area1)
    return overlaps
def compute_bbox_overlaps ( boxes1 , boxes2 ) : area1 = ( boxes1 [ : , 2 ] - boxes1 [ : , 0 ] ) * ( boxes1 [ : , 3 ] - boxes1 [ : , 1 ] ) area2 = ( boxes2 [ : , 2 ] - boxes2 [ : , 0 ] ) * ( boxes2 [ : , 3 ] - boxes2 [ : , 1 ] ) overlaps = np . zeros ( ( boxes1 . shape [ 0 ] , boxes2 . shape [ 0 ] ) ) for i in range ( overlaps . shape [ 1 ] ) : box2 = boxes2 [ i ] overlaps [ : , i ] = compute_bbox_iou ( box2 , boxes1 , area2 [ i ] , area1 ) return overlaps
Computes IoU overlaps between two sets of boxes.
Computes IoU overlaps between two sets of boxes .
"""Computes IoU overlaps between two sets of boxes.
    boxes1, boxes2: [N, (y1, x1, y2, x2)].

    For better performance, pass the largest set first and the smaller second.
    """ # Areas of anchors and GT boxes # Compute overlaps to generate matrix [boxes1 count, boxes2 count] # Each cell contains the IoU value. #先对gt做处理计算iou #对box_pre的处理在compute_iou函数中进行
boxes1
boxes2