-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
70 lines (51 loc) · 1.44 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Configuration settings for the project
import albumentations as A
import torch
# Batch size for dataloaders
BATCH_SIZE = 2
EPOCHS = 50
# Number of classes
NC = 19
# Number of workers for DataLoader
NUM_WORKERS = 8
# Image sizes for different datasets
CITYSCAPE_SIZE = (512, 1024)
GTA5_SIZE = (720, 1280)
transforms = A.Compose([
A.Resize(CITYSCAPE_SIZE[0], CITYSCAPE_SIZE[1]),
])
transforms_GTA5 = A.Compose([
A.Resize(GTA5_SIZE[0], GTA5_SIZE[1]),
])
augmentations = A.Compose([
A.Resize(GTA5_SIZE[0], GTA5_SIZE[1]),
A.ColorJitter(p=0.5),
A.GaussianBlur(p=0.5),
])
# We used them to compare different augmentations
# augmentations = {
# 'transform1': A.Compose([
# A.Resize(GTA5_SIZE[0], GTA5_SIZE[1]),
# A.HorizontalFlip(p=0.5),
# A.ColorJitter(p=0.5),
# ]),
# 'transform2': A.Compose([
# A.Resize(GTA5_SIZE[0], GTA5_SIZE[1]),
# A.ColorJitter(p=0.5),
# A.GaussianBlur(p=0.5),
# ]),
# 'transform3': A.Compose([
# A.Resize(GTA5_SIZE[0], GTA5_SIZE[1]),
# A.HorizontalFlip(p=0.5),
# A.GaussianBlur(p=0.5),
# ]),
# 'transform4': A.Compose([
# A.Resize(GTA5_SIZE[0], GTA5_SIZE[1]),
# A.ColorJitter(p=0.5),
# A.GaussianBlur(p=0.5),
# A.GaussNoise(p=0.5),
# ]),
# }
deeplab_pretrained_model_path = './models/deeplab_resnet_pretrained_imagenet.pth'
cityscapes_path = './Cityscapes'
gta5_path = './GTA5'