box_iou¶ torchvision.ops.box_iou(boxes1: Tensor, boxes2: Tensor) → Tensor[source]¶ 返回两个框集之间的交并比(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]