BatchVideoResize#
- class torchaug.batch_transforms.BatchVideoResize(size, interpolation=InterpolationMode.BILINEAR, max_size=None, antialias=True, video_format='CTHW')[source]#
Resize the input video to the given size. The video is expected to have [B, …, H, W] shape, where … means an arbitrary number of dimensions.
- Parameters:
size (
int|list[int]) –Desired output size. If size is a sequence like (h, w), output size will be matched to this. If size is an int, smaller edge of the image will be matched to this number. i.e, if height > width, then image will be rescaled to (size * height / width, size).
Note
In torchscript mode size as single int is not supported, use a sequence of length 1:
[size, ].interpolation (
InterpolationMode, optional) – Desired interpolation enum defined bytorchvision.transforms.InterpolationMode.InterpolationMode.NEAREST,InterpolationMode.NEAREST_EXACT,InterpolationMode.BILINEARandInterpolationMode.BICUBICare supported.Default:InterpolationMode.BILINEARmax_size (
Optional[int], optional) – The maximum allowed for the longer edge of the resized image: if the longer edge of the image is greater thanmax_sizeafter being resized according tosize, then the image is resized again so that the longer edge is equal tomax_size. As a result,sizemight be overruled, i.e. the smaller edge may be shorter thansize. This is only supported ifsizeis an int (or a sequence of length 1 in torchscript mode).Default:Noneantialias (
bool, optional) – Whether to apply antialiasing. IfTrue, will apply antialiasing for bilinear or bicubic modes. Other mode aren’t affected.