-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.py
52 lines (46 loc) · 1.38 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
import torch
import albumentations as A
from albumentations.pytorch import ToTensorV2
DEVICE = "cuda" if torch.cuda.is_available() else "cpu";
LEARNING_RATE = 1e-4
BATCH_SIZE = 2
NUM_WORKERS = 1
IMAGE_SIZE = 1024
VIRUTAL_BATCH = 2;
NUM_EPOCHS = 40
EPSILON = 1e-5
NUM_CLASSES = 1;
PROJECT_NAME = '';
PROJECT_ROOT = '';
MAX_PEN_SIZE = 300;
FINISH_TRAINING = False;
PREDEFINED_COLORS = [[0, 0, 255], [255, 0, 0], [0, 255, 0], [102, 0, 204], [255, 102, 102], [255, 128, 0], [255, 255, 0]];
PREDEFINED_NAMES = ['Vertebra', 'Spinous process', 'Ribs', 'Thoracic Limbs', 'Pulmonary Arteries', 'Mediastinum', 'Trachea', 'Bronchi', 'Abdomen', 'Lung', 'Spine'];
PROJECT_PREDEFINED_NAMES = [];
NEXT_SAMPLE_SELECTION = 'In order';
MUTUAL_EXCLUSION = True;
MUTUAL_EXCLUSION = False;
#Initialize transforms for training and validation
train_transforms = A.Compose(
[
A.Resize(IMAGE_SIZE,IMAGE_SIZE),
A.HorizontalFlip(p=0.5),
A.Normalize(mean = [0.485, 0.456, 0.406], std = [0.229, 0.224, 0.225]),
ToTensorV2(),
],
additional_targets={'mask': 'mask'}
)
valid_transforms = A.Compose(
[
A.Resize(IMAGE_SIZE,IMAGE_SIZE),
A.Normalize(mean = [0.485, 0.456, 0.406], std = [0.229, 0.224, 0.225]),
ToTensorV2()
]
)
predict_transforms = A.Compose(
[
A.LongestMaxSize(max_size = IMAGE_SIZE),
A.Normalize(mean = [0.485, 0.456, 0.406], std = [0.229, 0.224, 0.225]),
ToTensorV2()
]
)