Convert bounding box to format `(center x, center y, aspect ratio, height)`, where the aspect ratio is `width / height`.
(tlwh)
| 137 | @staticmethod |
| 138 | # @jit(nopython=True) |
| 139 | def tlwh_to_xyah(tlwh): |
| 140 | """Convert bounding box to format `(center x, center y, aspect ratio, |
| 141 | height)`, where the aspect ratio is `width / height`. |
| 142 | """ |
| 143 | ret = np.asarray(tlwh).copy() |
| 144 | ret[:2] += ret[2:] / 2 |
| 145 | ret[2] /= ret[3] |
| 146 | return ret |
| 147 | |
| 148 | def to_xyah(self): |
| 149 | return self.tlwh_to_xyah(self.tlwh) |
no outgoing calls
no test coverage detected