-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.py
38 lines (34 loc) · 942 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
36
37
38
import albumentations as A
import torch
from albumentations.pytorch import ToTensorV2
DEVICE = "cuda:5" if torch.cuda.is_available() else "cpu"
TRAIN_DIR = "underwater_imagenet"
LEARNING_RATE = 2e-4
BATCH_SIZE = 64
NUM_WORKERS = 2
IMAGE_SIZE = 256
CHANNELS_IMG = 3
L1_LAMBDA = 100
LAMBDA_GP = 10
NUM_EPOCHS = 500
LOAD_MODEL = False
SAVE_MODEL = True
CHECKPOINT_DISC = "disc.pth.tar"
CHECKPOINT_GEN = "gen.pth.tar"
DEVICE_IDs = [5, 2, 3, 4] if torch.cuda.is_available() else ["cpu"]
both_transform = A.Compose(
[A.Resize(width=256, height=256)], additional_targets={"image0": "image"},
)
transform_only_input = A.Compose(
[
A.ColorJitter(p=0.2),
A.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], max_pixel_value=255.0, ),
ToTensorV2(),
]
)
transform_only_mask = A.Compose(
[
A.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], max_pixel_value=255.0, ),
ToTensorV2(),
]
)