Shortcuts

广义框交并比

torchvision.ops.generalized_box_iou(boxes1: Tensor, boxes2: Tensor) Tensor[source]

返回两组框之间的广义交并比(Jaccard指数)。

两组框都应以(x1, y1, x2, y2)格式表示,其中 0 <= x1 < x20 <= y1 < y2

Parameters:
  • boxes1 (Tensor[N, 4]) – 第一组框

  • boxes2 (Tensor[M, 4]) – 第二组框

Returns:

包含boxes1和boxes2中每个元素的成对广义IoU值的NxM矩阵

Return type:

张量[N, M]