Compute cost based on IoU :type atlbrs: list[tlbr] | np.ndarray :type atlbrs: list[tlbr] | np.ndarray :rtype ious np.ndarray
(atlbrs, btlbrs)
| 62 | |
| 63 | |
| 64 | def ious(atlbrs, btlbrs): |
| 65 | """ |
| 66 | Compute cost based on IoU |
| 67 | :type atlbrs: list[tlbr] | np.ndarray |
| 68 | :type atlbrs: list[tlbr] | np.ndarray |
| 69 | |
| 70 | :rtype ious np.ndarray |
| 71 | """ |
| 72 | ious = np.zeros((len(atlbrs), len(btlbrs)), dtype=np.float) |
| 73 | if ious.size == 0: |
| 74 | return ious |
| 75 | |
| 76 | ious = bbox_ious( |
| 77 | np.ascontiguousarray(atlbrs, dtype=np.float), |
| 78 | np.ascontiguousarray(btlbrs, dtype=np.float) |
| 79 | ) |
| 80 | |
| 81 | return ious |
| 82 | |
| 83 | |
| 84 | def iou_distance(atracks, btracks): |