Convert bounding box to format `(center x, center y, aspect ratio, height)`, where the aspect ratio is `width / height`.
(tlwh)
| 146 | @staticmethod |
| 147 | # @jit(nopython=True) |
| 148 | def tlwh_to_xyah(tlwh): |
| 149 | """Convert bounding box to format `(center x, center y, aspect ratio, |
| 150 | height)`, where the aspect ratio is `width / height`. |
| 151 | """ |
| 152 | ret = np.asarray(tlwh).copy() |
| 153 | ret[:2] += ret[2:] / 2 |
| 154 | ret[2] /= ret[3] |
| 155 | return ret |
| 156 | |
| 157 | def to_xyah(self): |
| 158 | return self.tlwh_to_xyah(self.tlwh) |
no outgoing calls
no test coverage detected