Convert bounding box to format `(center x, center y, aspect ratio, height)`, where the aspect ratio is `width / height`.
(tlwh)
| 107 | |
| 108 | @staticmethod |
| 109 | def tlwh_to_xyah(tlwh): |
| 110 | """Convert bounding box to format `(center x, center y, aspect ratio, |
| 111 | height)`, where the aspect ratio is `width / height`. |
| 112 | """ |
| 113 | ret = np.asarray(tlwh).copy() |
| 114 | ret[:2] += ret[2:] / 2 |
| 115 | ret[2] /= ret[3] |
| 116 | return ret |
| 117 | |
| 118 | def to_xyah(self): |
| 119 | return self.tlwh_to_xyah(self.tlwh) |
no outgoing calls
no test coverage detected