1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# Rotation
transform_rotate = transforms.RandomRotation(degrees=30)
# Translation
transform_translate = transforms.RandomAffine(degrees=0, translate=(0.1, 0.1))
# Flipping
transform_flip = transforms.RandomHorizontalFlip(p=0.5)
# Scaling
transform_scale = transforms.RandomResizedCrop(size=224, scale=(0.8, 1.0))
# Shearing
transform_shear = transforms.RandomAffine(degrees=0, shear=20)
|