-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathaugmentation.py
More file actions
37 lines (29 loc) · 767 Bytes
/
augmentation.py
File metadata and controls
37 lines (29 loc) · 767 Bytes
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
33
34
35
36
37
from albumentations import *
def train_aug(p=1.0, image_size=256):
return Compose([
Resize(image_size, image_size),
# GaussNoise(),
# HorizontalFlip(0.5),
# Rotate(limit=10),
# Normalize(),
], p=p)
def valid_aug(p=1.0, image_size=256):
return Compose([
Resize(image_size, image_size),
# Normalize(),
], p=p)
def test_aug(p=1.0, image_size=256):
return Compose([
Resize(image_size, image_size),
# Normalize(),
], p=p)
def test_tta(p=1.0, image_size=256):
return [
Compose([
Resize(image_size, image_size),
HorizontalFlip(p=1),
], p=p),
Compose([
Resize(image_size, image_size),
], p=p),
]