MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / box_cxcywh_to_xyxy

Function box_cxcywh_to_xyxy

util/box_ops.py:5–8  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

3
4
5def box_cxcywh_to_xyxy(x):
6 x_c, y_c, w, h = x.unbind(-1)
7 b = [(x_c - 0.5 * w), (y_c - 0.5 * h), (x_c + 0.5 * w), (y_c + 0.5 * h)]
8 return torch.stack(b, dim=-1)
9
10
11def box_xyxy_to_cxcywh(x):

Callers 2

forwardMethod · 0.90
forwardMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected