Compute cost based on IoU :type atlbrs: list[tlbr] | np.ndarray :type atlbrs: list[tlbr] | np.ndarray :rtype ious np.ndarray
(atlbrs, btlbrs)
| 33 | |
| 34 | |
| 35 | def ious(atlbrs, btlbrs): |
| 36 | """ |
| 37 | Compute cost based on IoU |
| 38 | :type atlbrs: list[tlbr] | np.ndarray |
| 39 | :type atlbrs: list[tlbr] | np.ndarray |
| 40 | :rtype ious np.ndarray |
| 41 | """ |
| 42 | ious = np.zeros((len(atlbrs), len(btlbrs)), dtype=np.float) |
| 43 | if ious.size == 0: |
| 44 | return ious |
| 45 | |
| 46 | ious = bbox_ious( |
| 47 | np.ascontiguousarray(atlbrs, dtype=np.float), |
| 48 | np.ascontiguousarray(btlbrs, dtype=np.float) |
| 49 | ) |
| 50 | |
| 51 | return ious |
| 52 | |
| 53 | |
| 54 | def iou_distance(atracks, btracks): |