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