box_iou¶
- torchvision.ops.box_iou(boxes1: Tensor, boxes2: Tensor, fmt: str = 'xyxy') Tensor [source]¶
Return intersection-over-union (Jaccard index) between two sets of boxes from a given format.
- Parameters:
boxes1 (Tensor[..., N, 4]) – first set of boxes
boxes2 (Tensor[..., M, 4]) – second set of boxes
fmt (str) – Format of the input boxes. Default is “xyxy” to preserve backward compatibility. Supported formats are “xyxy”, “xywh”, and “cxcywh”.
- Returns:
the NxM matrix containing the pairwise IoU values for every element in boxes1 and boxes2
- Return type:
Tensor[…, N, M]