MCPcopy Create free account
hub / github.com/MaureenZOU/TSAM / _decide_patch_num

Function _decide_patch_num

src/utils/util.py:112–116  ·  view source on GitHub ↗
(box_width, patch_size)

Source from the content-addressed store, hash-verified

110
111def get_extended_from_box(img_size, box, patch_size):
112 def _decide_patch_num(box_width, patch_size):
113 num = np.ceil(box_width / patch_size).astype(np.int)
114 if (num * patch_size - box_width) < (patch_size // 2):
115 num += 1
116 return num
117
118 x1, y1 = box[0]
119 x2, y2 = box[1]

Callers 1

get_extended_from_boxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected