MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / _scale_box

Function _scale_box

examples/FasterRCNN/eval.py:44–58  ·  view source on GitHub ↗
(box, scale)

Source from the content-addressed store, hash-verified

42
43
44def _scale_box(box, scale):
45 w_half = (box[2] - box[0]) * 0.5
46 h_half = (box[3] - box[1]) * 0.5
47 x_c = (box[2] + box[0]) * 0.5
48 y_c = (box[3] + box[1]) * 0.5
49
50 w_half *= scale
51 h_half *= scale
52
53 scaled_box = np.zeros_like(box)
54 scaled_box[0] = x_c - w_half
55 scaled_box[2] = x_c + w_half
56 scaled_box[1] = y_c - h_half
57 scaled_box[3] = y_c + h_half
58 return scaled_box
59
60
61def _paste_mask(box, mask, shape):

Callers 1

_paste_maskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected