MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / _resize

Function _resize

eval/utils/evaluator.py:37–45  ·  view source on GitHub ↗
(box: List[float])

Source from the content-addressed store, hash-verified

35 """Uniformly enlarge bbox(es) by the given factors."""
36
37 def _resize(box: List[float]):
38 y, x, h, w = box
39 h_delta = (height_factor - 1) * h
40 w_delta = (width_factor - 1) * w
41 y = max(0, y - h_delta / 2)
42 x = max(0, x - w_delta / 2)
43 h = min(1, h + h_delta)
44 w = min(1, w + w_delta)
45 return [y, x, h, w]
46
47 if not annotation_position:
48 return []

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected