peal.data.transformations.RandomResizeCropPad¶
- class peal.data.transformations.RandomResizeCropPad[source]¶
Bases:
objectRandom zoom augmentation that keeps the spatial size fixed.
The image is resized by a factor drawn uniformly from
scale_range, then padded with 0.5 (zoom out) and center-cropped (zoom in) back to the originalH x W.- Parameters:
scale_range (
tupleoffloat, optional) –(min, max)of the uniform scale factor. Defaults to (0.8, 1.2).
Methods
- __call__(img)[source]¶
Zoom
imgin or out and restore its original size.- Parameters:
img (
torch.Tensor) – Image of shape[..., H, W].- Returns:
Image of the same shape.
- Return type: