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