MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / center_crop

Function center_crop

utils/transforms.py:166–170  ·  view source on GitHub ↗
(img, shape)

Source from the content-addressed store, hash-verified

164
165
166def center_crop(img, shape):
167 h, w = shape[0], shape[1]
168 y = (img.shape[0] - h) // 2
169 x = (img.shape[1] - w) // 2
170 return img[y : y + h, x : x + w]
171
172
173def random_crop(img, gt, size):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected