當前位置: 首頁>>代碼示例>>Python>>正文


Python bbox.bbox_overlaps_cython方法代碼示例

本文整理匯總了Python中bbox.bbox_overlaps_cython方法的典型用法代碼示例。如果您正苦於以下問題:Python bbox.bbox_overlaps_cython方法的具體用法?Python bbox.bbox_overlaps_cython怎麽用?Python bbox.bbox_overlaps_cython使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bbox的用法示例。


在下文中一共展示了bbox.bbox_overlaps_cython方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: bbox_overlaps_cy

# 需要導入模塊: import bbox [as 別名]
# 或者: from bbox import bbox_overlaps_cython [as 別名]
def bbox_overlaps_cy(boxes, query_boxes):
    box_device = boxes.device
    boxes_np = boxes.cpu().numpy().astype(np.float)
    query_boxes_np = query_boxes.cpu().numpy().astype(np.float)
    ious = bbox_overlaps_cython(boxes_np, query_boxes_np)
    return torch.from_numpy(ious).to(box_device)

# def bbox_overlaps_cy2(boxes, query_boxes):
#     box_device = boxes.device
#     boxes_np = boxes.cpu().numpy().astype(np.float)
#     query_boxes_np = query_boxes.cpu().numpy().astype(np.float)
#     ious = bbox_overlaps_cython_v2(boxes_np, query_boxes_np)
#     return torch.from_numpy(ious).to(box_device) 
開發者ID:dingjiansw101,項目名稱:AerialDetection,代碼行數:15,代碼來源:geometry.py

示例2: mask_overlaps

# 需要導入模塊: import bbox [as 別名]
# 或者: from bbox import bbox_overlaps_cython [as 別名]
def mask_overlaps():
    pass

# def bbox_overlaps_cy(boxes, query_boxes):
#     box_device = boxes.device
#     boxes_np = boxes.cpu().numpy().astype(np.float)
#     query_boxes_np = query_boxes.cpu().numpy().astype(np.float)
#     ious = bbox_overlaps_cython(boxes_np, query_boxes_np)
#     return torch.from_numpy(ious).to(box_device) 
開發者ID:dingjiansw101,項目名稱:AerialDetection,代碼行數:11,代碼來源:geometry.py

示例3: rbbox_overlaps_cy_warp

# 需要導入模塊: import bbox [as 別名]
# 或者: from bbox import bbox_overlaps_cython [as 別名]
def rbbox_overlaps_cy_warp(rbboxes, query_boxes):
    # TODO: first calculate the hbb overlaps, for overlaps > 0, calculate the obb overlaps
    # import pdb
    # pdb.set_trace()
    box_device = query_boxes.device
    query_boxes_np = query_boxes.cpu().numpy().astype(np.float)

    # polys_np = RotBox2Polys(boxes_np)
    # TODO: change it to only use pos gt_masks
    # polys_np = mask2poly(gt_masks)
    # polys_np = np.array(Tuplelist2Polylist(polys_np)).astype(np.float)

    polys_np = RotBox2Polys(rbboxes).astype(np.float)
    query_polys_np = RotBox2Polys(query_boxes_np)

    h_bboxes_np = poly2bbox(polys_np)
    h_query_bboxes_np = poly2bbox(query_polys_np)

    # hious
    ious = bbox_overlaps_cython(h_bboxes_np, h_query_bboxes_np)
    import pdb
    # pdb.set_trace()
    inds = np.where(ious > 0)
    for index in range(len(inds[0])):
        box_index = inds[0][index]
        query_box_index = inds[1][index]

        box = polys_np[box_index]
        query_box = query_polys_np[query_box_index]

        # calculate obb iou
        # import pdb
        # pdb.set_trace()
        overlap = polyiou.iou_poly(polyiou.VectorDouble(box), polyiou.VectorDouble(query_box))
        ious[box_index][query_box_index] = overlap

    return torch.from_numpy(ious).to(box_device) 
開發者ID:dingjiansw101,項目名稱:AerialDetection,代碼行數:39,代碼來源:geometry.py

示例4: rbbox_overlaps_cy

# 需要導入模塊: import bbox [as 別名]
# 或者: from bbox import bbox_overlaps_cython [as 別名]
def rbbox_overlaps_cy(boxes_np, query_boxes_np):
    # TODO: first calculate the hbb overlaps, for overlaps > 0, calculate the obb overlaps

    polys_np = RotBox2Polys(boxes_np).astype(np.float)
    query_polys_np = RotBox2Polys(query_boxes_np).astype(np.float)

    h_bboxes_np = poly2bbox(polys_np).astype(np.float)
    h_query_bboxes_np = poly2bbox(query_polys_np).astype(np.float)

    # hious
    ious = bbox_overlaps_cython(h_bboxes_np, h_query_bboxes_np)
    import pdb
    # pdb.set_trace()
    inds = np.where(ious > 0)
    for index in range(len(inds[0])):
        box_index = inds[0][index]
        query_box_index = inds[1][index]

        box = polys_np[box_index]
        query_box = query_polys_np[query_box_index]

        # calculate obb iou
        # import pdb
        # pdb.set_trace()
        overlap = polyiou.iou_poly(polyiou.VectorDouble(box), polyiou.VectorDouble(query_box))
        ious[box_index][query_box_index] = overlap

    return ious 
開發者ID:dingjiansw101,項目名稱:AerialDetection,代碼行數:30,代碼來源:geometry.py

示例5: bbox_overlaps

# 需要導入模塊: import bbox [as 別名]
# 或者: from bbox import bbox_overlaps_cython [as 別名]
def bbox_overlaps(boxes, query_boxes):
    return bbox_overlaps_cython(boxes, query_boxes) 
開發者ID:tonysy,項目名稱:Deep-Feature-Flow-Segmentation,代碼行數:4,代碼來源:bbox_transform.py


注:本文中的bbox.bbox_overlaps_cython方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。