MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / get_transform

Method get_transform

PATH/core/data/transforms/seg_aug_dev.py:522–528  ·  view source on GitHub ↗
(self, image)

Source from the content-addressed store, hash-verified

520 self._init(locals())
521
522 def get_transform(self, image):
523 h, w = image.shape[:2]
524 croph, cropw = self.get_crop_size((h, w))
525 assert h >= croph and w >= cropw, "Shape computation in {} has bugs.".format(self)
526 h0 = np.random.randint(h - croph + 1)
527 w0 = np.random.randint(w - cropw + 1)
528 return CropTransform(w0, h0, cropw, croph)
529
530 def get_crop_size(self, image_size):
531 """

Callers

nothing calls this directly

Calls 2

get_crop_sizeMethod · 0.95
CropTransformClass · 0.85

Tested by

no test coverage detected