box_iou¶
- torchvision.ops.box_iou(boxes1: Tensor, boxes2: Tensor, fmt: str = 'xyxy') Tensor [源代码]¶
返回两个框集中框之间的交并比(Jaccard 指数),给定输入框的格式。
- 参数:
boxes1 (Tensor[..., N, 4]) – 第一个框集
boxes2 (Tensor[..., M, 4]) – 第二个框集
fmt (str) – 输入框的格式。默认为“xyxy”以保持向后兼容性。支持的格式为“xyxy”、“xywh”和“cxcywh”。
- 返回:
包含 boxes1 和 boxes2 中每个元素之间成对 IoU 值的 NxM 矩阵
- 返回类型:
Tensor[…, N, M]