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]