-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
35 lines (33 loc) · 837 Bytes
/
config.py
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
import torch
import albumentations as A
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
LEARNING_RATE = 1e-4
WEIGHT_DECAY = 5e-4
BATCH_SIZE = 8
NUM_EPOCHS = 10
NUM_WORKERS = 2
CHECKPOINT_FILE = "checkpoint.pth.tar"
PIN_MEMORY = True
SAVE_MODEL = True
LOAD_MODEL = True
TRAIN_DIR = 'dataset/train'
VALID_DIR = 'dataset/valid'
TEST_DIR = 'dataset/test'
IMAGE_SIZE = [1152,648]
transform = A.Compose([
A.HorizontalFlip(p=0.5),
A.RandomBrightnessContrast(
contrast_limit=0.2, brightness_limit=0.3, p=0.5),
A.OneOf([
A.ImageCompression(p=0.8),
A.RandomGamma(p=0.8),
A.Blur(p=0.8),
A.Equalize(mode='cv',p=0.8)
], p=1.0),
A.OneOf([
A.ImageCompression(p=0.8),
A.RandomGamma(p=0.8),
A.Blur(p=0.8),
A.Equalize(mode='cv',p=0.8),
], p=1.0),
])