-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
57 lines (53 loc) · 1.28 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
from albumentations.augmentations.geometric import Resize
import torch
import albumentations as A
from albumentations.pytorch import ToTensorV2
from PIL import Image
ROOT_DIR = "/home/foolofatook/.local/share/virtualenvs/SRGAN-iaZ_xZpr/lib/python3.9/site-packages/"
DEVICE = torch.device('cuda' if torch.cuda.is_available() else "cpu")
LOAD_MODEL = False
SAVE_MODEL = True
CHECKPOINT_GEN = "gen"
CHECKPOINT_DISC = "dis"
LAMBDA_GP = 10
LEARNING_RATE = 1e-4
NUM_EPOCHS = 10000
BATCH_SIZE = 16
NUM_WORKERS = 4
HIGH_RES = 128
LOW_RES = HIGH_RES // 4
IMG_CHANNELS = 3
highres_transform = A.Compose(
[
A.Normalize(mean=[0,0,0],std=[1,1,1,]),
ToTensorV2()
]
)
lowres_transform = A.Compose(
[
A.Resize(width=LOW_RES,height=LOW_RES,interpolation= Image.BICUBIC),
A.Normalize(mean=[0,0,0],std=[1,1,1]),
ToTensorV2()
]
)
both_transforms = A.Compose(
[
A.RandomCrop(width=HIGH_RES, height=HIGH_RES),
A.HorizontalFlip(p=0.5),
A.RandomRotate90(p=0.5),
]
)
test_transform = A.Compose(
[
# A.Resize(512,512),
A.Normalize(mean=[0,0,0],std=[1,1,1]),
ToTensorV2()
]
)
custom_transform = A.Compose(
[
A.Resize(512,512),
A.Normalize(mean=[0,0,0],std=[1,1,1]),
ToTensorV2()
]
)