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

Method _xyxy_to_tlwh_array

yolox/deepsort_tracker/deepsort.py:230–237  ·  view source on GitHub ↗
(bbox_xyxy)

Source from the content-addressed store, hash-verified

228
229 @staticmethod
230 def _xyxy_to_tlwh_array(bbox_xyxy):
231 if isinstance(bbox_xyxy, np.ndarray):
232 bbox_tlwh = bbox_xyxy.copy()
233 elif isinstance(bbox_xyxy, torch.Tensor):
234 bbox_tlwh = bbox_xyxy.clone()
235 bbox_tlwh[:, 2] = bbox_xyxy[:, 2] - bbox_xyxy[:, 0]
236 bbox_tlwh[:, 3] = bbox_xyxy[:, 3] - bbox_xyxy[:, 1]
237 return bbox_tlwh
238
239 def _xywh_to_xyxy(self, bbox_xywh):
240 x, y, w, h = bbox_xywh

Callers 1

updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected