MCPcopy Create free account
hub / github.com/DPS2022/diffusion-posterior-sampling / local_patch

Function local_patch

util/tools.py:165–171  ·  view source on GitHub ↗
(x, bbox_list)

Source from the content-addressed store, hash-verified

163
164
165def local_patch(x, bbox_list):
166 assert len(x.size()) == 4
167 patches = []
168 for i, bbox in enumerate(bbox_list):
169 t, l, h, w = bbox
170 patches.append(x[i, :, t:t + h, l:l + w])
171 return torch.stack(patches, dim=0)
172
173
174def mask_image(x, bboxes, config):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected