Compute cost based on IoU :type atlbrs: list[tlbr] | np.ndarray :type atlbrs: list[tlbr] | np.ndarray :rtype ious np.ndarray
(atlbrs, btlbrs)
| 51 | |
| 52 | |
| 53 | def ious(atlbrs, btlbrs): |
| 54 | """ |
| 55 | Compute cost based on IoU |
| 56 | :type atlbrs: list[tlbr] | np.ndarray |
| 57 | :type atlbrs: list[tlbr] | np.ndarray |
| 58 | |
| 59 | :rtype ious np.ndarray |
| 60 | """ |
| 61 | ious = np.zeros((len(atlbrs), len(btlbrs)), dtype=np.float) |
| 62 | if ious.size == 0: |
| 63 | return ious |
| 64 | |
| 65 | ious = bbox_ious( |
| 66 | np.ascontiguousarray(atlbrs, dtype=np.float), |
| 67 | np.ascontiguousarray(btlbrs, dtype=np.float) |
| 68 | ) |
| 69 | |
| 70 | return ious |
| 71 | |
| 72 | |
| 73 | def iou_distance(atracks, btracks): |
no outgoing calls
no test coverage detected