Rescales the input PIL.Image to the given 'size'. 'size' will be the size of the smaller edge. For example, if height > width, then image will be rescaled to (size * height / width, size) size: size of the smaller edge interpolation: Default: PIL.Image.BILINEAR
| 80 | |
| 81 | |
| 82 | class GroupScale(object): |
| 83 | """ Rescales the input PIL.Image to the given 'size'. |
| 84 | 'size' will be the size of the smaller edge. |
| 85 | For example, if height > width, then image will be |
| 86 | rescaled to (size * height / width, size) |
| 87 | size: size of the smaller edge |
| 88 | interpolation: Default: PIL.Image.BILINEAR |
| 89 | """ |
| 90 | |
| 91 | def __init__(self, size, interpolation=Image.BILINEAR): |
| 92 | self.worker = torchvision.transforms.Resize(size, interpolation) |
| 93 | |
| 94 | def __call__(self, img_group): |
| 95 | return [self.worker(img) for img in img_group] |
| 96 | |
| 97 | |
| 98 | class GroupOverSample(object): |
no outgoing calls
no test coverage detected