Convert bounding box to format `(center x, center y, aspect ratio, height)`, where the aspect ratio is `width / height`.
(tlwh)
| 115 | @staticmethod |
| 116 | # @jit(nopython=True) |
| 117 | def tlwh_to_xyah(tlwh): |
| 118 | """Convert bounding box to format `(center x, center y, aspect ratio, |
| 119 | height)`, where the aspect ratio is `width / height`. |
| 120 | """ |
| 121 | ret = np.asarray(tlwh).copy() |
| 122 | ret[:2] += ret[2:] / 2 |
| 123 | ret[2] /= ret[3] |
| 124 | return ret |
| 125 | |
| 126 | def to_xyah(self): |
| 127 | return self.tlwh_to_xyah(self.tlwh) |
no outgoing calls
no test coverage detected