(rect1, rect2, iob_threshold)
| 109 | |
| 110 | |
| 111 | def IoB(rect1, rect2, iob_threshold): |
| 112 | b = (rect2[:, 2] - rect2[:, 0] + 1) * (rect2[:, 3] - rect2[:, 1] + 1) |
| 113 | # from IPython import embed; embed() $TODO |
| 114 | xx1 = np.maximum(rect1[:, 0], rect2[:, 0]) |
| 115 | yy1 = np.maximum(rect1[:, 1], rect2[:, 1]) |
| 116 | xx2 = np.minimum(rect1[:, 2], rect2[:, 2]) |
| 117 | yy2 = np.minimum(rect1[:, 3], rect2[:, 3]) |
| 118 | dx = np.maximum(0, xx2 - xx1 + 1) |
| 119 | dy = np.maximum(0, yy2 - yy1 + 1) |
| 120 | i = dx * dy |
| 121 | ov = i / b |
| 122 | ov[b < 0] = 0 |
| 123 | return ov |
| 124 | |
| 125 | |
| 126 | def IoU(rect1, rect2, iob_threshold): |
nothing calls this directly
no outgoing calls
no test coverage detected