本文整理汇总了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)
示例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)
示例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)
示例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
示例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)