box_iou¶ torchvision.ops.box_iou(boxes1: Tensor, boxes2: Tensor) → Tensor[原始碼]¶ 傳回兩組框之間的交集重疊率 (IoU,Jaccard 索引)。 兩組框都應為 (x1, y1, x2, y2) 格式,且 0 <= x1 < x2 和 0 <= y1 < y2。 參數: boxes1 (Tensor[N, 4]) – 第一組框 boxes2 (Tensor[M, 4]) – 第二組框 傳回: 包含 boxes1 和 boxes2 中每個元素之成對 IoU 值的 NxM 矩陣 傳回類型: Tensor[N, M]