faster-rcnn中bbox_iou函数“np.maximum(bbox_a[:, None, :2], bbox_b[:, :2])”的含义

函数“np.maximum(bbox_a[:, None, :2], bbox_b[:, :2])”的含义

bbox_a中每行元素逐一与bbox_b中每行元素进行对比

假设我们认为bbox_a.shape = [5, 4], bbox_b = [2, 4],具体数据如下:

bbox_a = np.array([ [9, 88, 9, 30],
                [63, 56, 9, 24],
                [4, 79, 93, 12],
                [34, 6, 21, 5],
                [81, 38, 80, 2]])
bbox_b = np.array([[27, 3, 84, 4],
                [34, 7, 9, 42]])

令:

bbox_c = np.maximum(aa[:,None, :2], bb[:, :2])

得如下结果:

(faster-rcnn) guo@dell-2060:~/faster-rcnn-pytorch$ python 001_test.py 
cc: [[[27 88]
  [34 88]]

 [[63 56]
  [63 56]]

 [[27 79]
  [34 79]]

 [[34  6]
  [34  7]]

 [[81 38]
  [81 38]]]

你可能感兴趣的:(deepstream,笔记,视觉,python)