File size: 895 Bytes
4db4d66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import albumentations as A
from albumentations.pytorch import ToTensorV2

train_transform = A.Compose(
    [
        A.PadIfNeeded(min_height=40, min_width=40, always_apply=True),
        A.RandomCrop(height=32, width=32, always_apply=True),
        A.HorizontalFlip(),
        A.CoarseDropout(
            min_holes=1,
            max_holes=1,
            min_height=8,
            min_width=8,
            max_height=8,
            max_width=8,
            fill_value=[0.49139968*255, 0.48215827*255 ,0.44653124*255],  # type: ignore
            p=0.5,
        ),
        A.Normalize((0.49139968, 0.48215827, 0.44653124),
                    (0.24703233, 0.24348505, 0.26158768)),
        ToTensorV2(),
    ]
)

test_transform = A.Compose(
    [
        A.Normalize((0.49139968, 0.48215827, 0.44653124),
                    (0.24703233, 0.24348505, 0.26158768)),
        ToTensorV2(),
    ]
)