Resize image to exact size of crop
| 370 | |
| 371 | |
| 372 | class Resize(object): |
| 373 | """ |
| 374 | Resize image to exact size of crop |
| 375 | """ |
| 376 | |
| 377 | def __init__(self, crop_size): |
| 378 | self.size = set_crop_size(crop_size) |
| 379 | |
| 380 | def __call__(self, img, mask): |
| 381 | assert img.size == mask.size |
| 382 | w, h = img.size |
| 383 | if (w == h and w == self.size): |
| 384 | return img, mask |
| 385 | return (img.resize(self.size, Image.BICUBIC), |
| 386 | mask.resize(self.size, Image.NEAREST)) |
| 387 | |
| 388 | |
| 389 | class RandomSizedCrop(object): |
nothing calls this directly
no outgoing calls
no test coverage detected