(self, image)
| 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 | """ |
nothing calls this directly
no test coverage detected