MCPcopy Index your code
hub / github.com/FoundationVision/ByteTrack / tlwh_to_xyah

Method tlwh_to_xyah

tutorials/cstrack/byte_tracker.py:121–128  ·  view source on GitHub ↗

Convert bounding box to format `(center x, center y, aspect ratio, height)`, where the aspect ratio is `width / height`.

(tlwh)

Source from the content-addressed store, hash-verified

119 @staticmethod
120 # @jit(nopython=True)
121 def tlwh_to_xyah(tlwh):
122 """Convert bounding box to format `(center x, center y, aspect ratio,
123 height)`, where the aspect ratio is `width / height`.
124 """
125 ret = np.asarray(tlwh).copy()
126 ret[:2] += ret[2:] / 2
127 ret[2] /= ret[3]
128 return ret
129
130 def to_xyah(self):
131 return self.tlwh_to_xyah(self.tlwh)

Callers 4

activateMethod · 0.95
re_activateMethod · 0.95
updateMethod · 0.95
to_xyahMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected