目录
pytorch预处理
这里面有python单个 iou 和批量iou:
pytorch 批量 iou_jacke121的专栏-CSDN博客
import torch
def intersect(box_a, box_b):
""" We resize both tensors to [A,B,2] without new malloc:
[A,2] -> [A,1,2] -> [A,B,2]
[B,2] -> [1,B,2] -> [A,B,2]
Then we compute the area of intersect between box_a and box_b.
Args:
¦ box_a: (tensor) bounding boxes, Shape: [A,4].
¦ box_b: (tensor) bounding boxes, Shape: [B,4].
Return:
¦ (