generalized_box_iou¶
- torchvision.ops.generalized_box_iou(boxes1: Tensor, boxes2: Tensor) Tensor [來源]¶
傳回兩組 bounding box 之間廣義的交集覆蓋率 (Intersection-over-Union, IoU)(Jaccard 索引)。
兩組 bounding box 預期為
(x1, y1, x2, y2)
格式,且0 <= x1 < x2
和0 <= y1 < y2
。- 參數:
boxes1 (Tensor[N, 4]) – 第一組 bounding box
boxes2 (Tensor[M, 4]) – 第二組 bounding box
- 傳回:
NxM 矩陣,包含 boxes1 和 boxes2 中每個元素的成對廣義 IoU 值
- 傳回類型:
Tensor[N, M]