cvtools.utils.iou module

cvtools.utils.iou.bbox_overlaps(bboxes1, bboxes2, mode='iou')[源代码]

Calculate the ious between each bbox of bboxes1 and bboxes2.

参数:
  • bboxes1 (ndarray) -- shape (n, 4)
  • bboxes2 (ndarray) -- shape (k, 4)
  • mode (str) -- iou (intersection over union) or iof (intersection over foreground)
返回:

shape (n, k)

返回类型:

ious(ndarray)

cvtools.utils.iou.box_ious(b1, b2, center=False)[源代码]

Return iou tensor

参数:
  • b1 (array, shape=(i1,..,iN, 4), xywh or x1y1x2y2) --
  • b2 (array, shape=(j, 4), xywh or x1y1x2y2) --
  • center (box format) --
返回:

iou

返回类型:

array, shape=(i1,..,iN, j)