RandomShortestSize¶
- class torchaug.transforms.RandomShortestSize(min_size, max_size=None, interpolation=InterpolationMode.BILINEAR, antialias=True)[source]¶
Randomly resize the input.
If the input is a
torch.Tensoror aTATensor(e.g.Image,Video,BoundingBoxesetc.) it can have arbitrary number of leading batch dimensions. For example, the image can have[..., C, H, W]shape. A bounding box can have[..., 4]shape.- Parameters:
min_size (
Union[List[int],Tuple[int],int]) – Minimum spatial size. Single integer value or a sequence of integer values.max_size (
Optional[int], optional) – Maximum spatial size. Default, None. Default:Noneinterpolation (
Union[InterpolationMode,int], optional) – Desired interpolation enum defined bytorchvision.transforms.InterpolationMode. OnlyInterpolationMode.NEAREST,InterpolationMode.NEAREST_EXACT,InterpolationMode.BILINEARandInterpolationMode.BICUBICare supported. Default:InterpolationMode.BILINEARantialias (
bool, optional) – Whether to apply antialiasing. Default:True