(box: List[float])
| 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 [] |
no outgoing calls
no test coverage detected