-
Notifications
You must be signed in to change notification settings - Fork 20
/
train_config.yaml
67 lines (57 loc) · 2.2 KB
/
train_config.yaml
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
TARGET: "cityscapes" # cityscapes or kitti
PATHS:
CITYSCAPES:
path_masks: "./data/cityscapes/gtFine/gtFine"
path_img: "./data/cityscapes/leftImg8bit"
# test_root_path: "./data/cityscapes/leftImg8bit/test"
test_root_path: "/samsung_drive/semantic_segmentation/data/cityscapes/demovideo/leftImg8bit/demoVideo"
val_cities: ["ulm", "bremen", "aachen"] # for cityscapes only
train_root_path: "./data/cityscapes/leftImg8bit/train"
KITTI:
path_masks: "./data/kitti/data_road/training/gt_image_2"
path_img: "./data/kitti/data_road/training/image_2"
test_root_path: "./data/kitti/data_road/testing/image_2"
val_frac: 0.2
mode: "lane" # lane or road in case of kitti-lanes dataset
DATASET:
hard_augs: False # add random snow / rain / fog
orig_size: [1024, 2048]
resize: [512, 1024] # or []
select_classes: []
train_on_cats: True # Must be False if select_classes is not empty else --> train on all classes
MODEL:
mode: "UNET" # UNET or FPN
backbone: "resnext50"
num_classes: 8
unet_res_blocks_decoder: False # adds residual blocks inside decoder --> net become heavier
TRAINING:
model_path: "/samsung_drive/semantic_segmentation/UNET_2x_downsize"
load_checkpoint: "/samsung_drive/semantic_segmentation/UNET_4x_downsize/last_model.pth"
# load_checkpoint: ""
weights_decay: 0.0
batch_size: 6
accumulation_batches: 1
freeze_n_iters: 0
load_optimizer_state: False
lr: 0.001
num_epochs: 40
devices_ids: [0, 1]
key_metric: "dice"
base_threshold: .0
activate: False
bce_loss_weight: .8
class_weights: [0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125]
scheduler_patience: 3
EVAL:
test_mode: True # doesn't calculate metrics
images_morphing: True # morph images and masks
model_path: "/samsung_drive/semantic_segmentation/UNET_2x_downsize/best_model.pth"
eval_images_path: "/samsung_drive/semantic_segmentation/UNET_2x_downsize/eval_images"
test_images_path: "/samsung_drive/semantic_segmentation/UNET_2x_downsize/test_images"
device: "cuda:0" # cpu or cuda
apply_tta: True
activate: False
base_threshold: 0.0
# activate: True
# base_threshold: 0.5
drop_clusters: 70 # no. pixels on one side; if <= 0 --> doesn't apply