_,axs = plt.subplots(1,3,figsize=(12,4))
f = RandomCrop(200)
for ax in axs: f(img).show(ctx=ax)
TensorImage and TensorMask as an item_tfm
Augmentations patched: RandomCrop, CropPad, Resize, RandomResizedCrop, & RatioResize.
These are all patched extensions of the fastai.vision.augment item transforms.
For details on how they work, see the fastai documentation.
encodes (x:Union[fastai.torch_core.TensorImage,fastai.torch_core.TensorM ask])
Extends RandomCrop to TensorImage & TensorMask
On the validation set, a center crop is always taken.
encodes (x:Union[fastai.torch_core.TensorImage,fastai.torch_core.TensorM ask])
Extends CropPad to TensorImage & TensorMask
encodes (x:Union[fastai.torch_core.TensorImage,fastai.torch_core.TensorM ask])
Extends Resize to TensorImage & TensorMask
_,axs = plt.subplots(1,3,figsize=(12,4))
for ax,method in zip(axs.flatten(), [ResizeMethod.Squish, ResizeMethod.Pad, ResizeMethod.Crop]):
rsz = Resize(256, method=method)
rsz(img, split_idx=0).show(ctx=ax, title=method)
On the validation set, the crop is always a center crop (on the dimension that’s cropped).
encodes (x:Union[fastai.torch_core.TensorImage,fastai.torch_core.TensorM ask])
Extends RandomResizedCrop to TensorImage & TensorMask
crop = RandomResizedCrop(256)
_,axs = plt.subplots(3,3,figsize=(9,9))
for ax in axs.flatten():
crop(img).show(ctx=ax)
Squish is used on the validation set, removing val_xtra proportion of each side first.
encodes (x:Union[fastai.torch_core.TensorImage,fastai.torch_core.TensorM ask])
Extends RatioResize to TensorImage & TensorMask