Convert bounding box to format `(center x, center y, aspect ratio, height)`, where the aspect ratio is `width / height`.
(tlwh)
| 124 | @staticmethod |
| 125 | # @jit(nopython=True) |
| 126 | def tlwh_to_xyah(tlwh): |
| 127 | """Convert bounding box to format `(center x, center y, aspect ratio, |
| 128 | height)`, where the aspect ratio is `width / height`. |
| 129 | """ |
| 130 | ret = np.asarray(tlwh).copy() |
| 131 | ret[:2] += ret[2:] / 2 |
| 132 | ret[2] /= ret[3] |
| 133 | return ret |
| 134 | |
| 135 | def to_xyah(self): |
| 136 | return self.tlwh_to_xyah(self.tlwh) |
no outgoing calls
no test coverage detected