# 需要导入模块: import albumentations [as 别名]
# 或者: from albumentations import Resize [as 别名]
def get_training_augmentation(resize_to=(320,640), crop_size=(288,576)):
print('[get_training_augmentation] crop_size:', crop_size, ', resize_to:', resize_to)
train_transform = [
albu.HorizontalFlip(p=0.5),
albu.VerticalFlip(p=0.5),
albu.ShiftScaleRotate(scale_limit=0.20, rotate_limit=10, shift_limit=0.1, p=0.5, border_mode=cv2.BORDER_CONSTANT, value=0),
albu.GridDistortion(p=0.5),
albu.Resize(*resize_to),
albu.RandomCrop(*crop_size),
albu.ChannelShuffle(),
albu.InvertImg(),
albu.ToGray(),
albu.Normalize(),
]
return albu.Compose(train_transform)
https://vimsky.com/examples/detail/python-method-albumentations.Resize.html