MCPcopy Create free account
hub / github.com/VitoHowe/glm-coding / poly_to_bbox

Function poly_to_bbox

app/services/tenvision_adapter.py:97–104  ·  view source on GitHub ↗
(poly)

Source from the content-addressed store, hash-verified

95 x2 = float(xs.max())
96 y2 = float(ys.max())
97 return int(round(x1)), int(round(y1)), int(round(x2 - x1)), int(round(y2 - y1))
98
99
100def bbox_iou(a, b):
101 ax, ay, aw, ah = a
102 bx, by, bw, bh = b
103 ax2, ay2 = ax + aw, ay + ah
104 bx2, by2 = bx + bw, by + bh
105
106 ix1 = max(ax, bx)
107 iy1 = max(ay, by)

Callers 1

ocr_itemsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected