(self, img, target)
| 432 | self.size = size |
| 433 | |
| 434 | def __call__(self, img, target): |
| 435 | image_width, image_height = img.size |
| 436 | crop_height, crop_width = self.size |
| 437 | crop_top = int(round((image_height - crop_height) / 2.)) |
| 438 | crop_left = int(round((image_width - crop_width) / 2.)) |
| 439 | return crop(img, target, (crop_top, crop_left, crop_height, crop_width)) |
| 440 | |
| 441 | |
| 442 | class MotCenterCrop(CenterCrop): |