MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / tlwh_to_xyah

Method tlwh_to_xyah

tutorials/qdtrack/tracker_reid_motion.py:135–142  ·  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

133 @staticmethod
134 # @jit(nopython=True)
135 def tlwh_to_xyah(tlwh):
136 """Convert bounding box to format `(center x, center y, aspect ratio,
137 height)`, where the aspect ratio is `width / height`.
138 """
139 ret = np.asarray(tlwh).copy()
140 ret[:2] += ret[2:] / 2
141 ret[2] /= ret[3]
142 return ret
143
144 def to_xyah(self):
145 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