Computes IUO between two bboxes in the form [x1,y1,x2,y2]
(bb_test, bb_gt)
| 14 | |
| 15 | @jit |
| 16 | def iou(bb_test, bb_gt): |
| 17 | """ |
| 18 | Computes IUO between two bboxes in the form [x1,y1,x2,y2] |
| 19 | """ |
| 20 | xx1 = np.maximum(bb_test[0], bb_gt[0]) |
| 21 | yy1 = np.maximum(bb_test[1], bb_gt[1]) |
| 22 | xx2 = np.minimum(bb_test[2], bb_gt[2]) |
| 23 | yy2 = np.minimum(bb_test[3], bb_gt[3]) |
| 24 | w = np.maximum(0., xx2 - xx1) |
| 25 | h = np.maximum(0., yy2 - yy1) |
| 26 | wh = w * h |
| 27 | o = wh / ((bb_test[2] - bb_test[0]) * (bb_test[3] - bb_test[1]) |
| 28 | + (bb_gt[2] - bb_gt[0]) * (bb_gt[3] - bb_gt[1]) - wh) |
| 29 | |
| 30 | return o |
| 31 | |
| 32 | |
| 33 | def convert_bbox_to_z(bbox): |
no outgoing calls
no test coverage detected