|
| 1 | +from yacs.config import CfgNode as CN |
| 2 | + |
| 3 | +# ----------------------------------------------------------------------------- |
| 4 | +# Config definition |
| 5 | +# ----------------------------------------------------------------------------- |
| 6 | + |
| 7 | +_C = CN() |
| 8 | + |
| 9 | +# ----------------------------------------------------------------------------- |
| 10 | +# Dataset |
| 11 | +# ----------------------------------------------------------------------------- |
| 12 | +_C.DATASET = CN() |
| 13 | +_C.DATASET.root_dataset = "./data/" |
| 14 | +_C.DATASET.list_train = "./data/training.odgt" |
| 15 | +_C.DATASET.list_val = "./data/validation.odgt" |
| 16 | +_C.DATASET.num_class = 150 |
| 17 | + |
| 18 | +# ----------------------------------------------------------------------------- |
| 19 | +# Model |
| 20 | +# ----------------------------------------------------------------------------- |
| 21 | +_C.MODEL = CN() |
| 22 | +# a name for identifying the model |
| 23 | +_C.MODEL.id = "baseline" |
| 24 | +# architecture of net_encoder |
| 25 | +_C.MODEL.arch_encoder = "resnet50dilated" |
| 26 | +# architecture of net_decoder |
| 27 | +_C.MODEL.arch_decoder = "ppm_deepsup" |
| 28 | +# weights to finetune net_encoder |
| 29 | +_C.MODEL.weights_encoder = "" |
| 30 | +# weights to finetune net_decoder |
| 31 | +_C.MODEL.weights_decoder = "" |
| 32 | +# number of feature channels between encoder and decoder |
| 33 | +_C.MODEL.fc_dim = 2048 |
| 34 | + |
| 35 | +# ----------------------------------------------------------------------------- |
| 36 | +# Training |
| 37 | +# ----------------------------------------------------------------------------- |
| 38 | +_C.TRAIN = CN() |
| 39 | +_C.TRAIN.batch_size_per_gpu = 2 |
| 40 | +# epochs to train for |
| 41 | +_C.TRAIN.num_epoch = 20 |
| 42 | +# epoch to start training. useful if continue from a checkpoint |
| 43 | +_C.TRAIN.start_epoch = 1 |
| 44 | +# iterations of each epoch (irrelevant to batch size) |
| 45 | +_C.TRAIN.epoch_iters = 5000 |
| 46 | + |
| 47 | +_C.TRAIN.optim = "SGD" |
| 48 | +_C.TRAIN.lr_encoder = 0.02 |
| 49 | +_C.TRAIN.lr_decoder = 0.02 |
| 50 | +# power in poly to drop LR |
| 51 | +_C.TRAIN.lr_pow = 0.9 |
| 52 | +# momentum for sgd, beta1 for adam |
| 53 | +_C.TRAIN.beta1 = 0.9 |
| 54 | +# weights regularizer |
| 55 | +_C.TRAIN.weight_decay = 1e-4 |
| 56 | +# the weighting of deep supervision loss |
| 57 | +_C.TRAIN.deep_sup_scale = 0.4 |
| 58 | +# fix bn params, only under finetuning |
| 59 | +_C.TRAIN.fix_bn = False |
| 60 | +# number of data loading workers |
| 61 | +_C.TRAIN.workers = 16 |
| 62 | + |
| 63 | +# input image size of short edge (int or tuple) |
| 64 | +_C.TRAIN.imgSize = (300, 375, 450, 525, 600) |
| 65 | +# maximum input image size of long edge |
| 66 | +_C.TRAIN.imgMaxSize = 1000 |
| 67 | +# maxmimum downsampling rate of the network |
| 68 | +_C.TRAIN.padding_constant = 8 |
| 69 | +# downsampling rate of the segmentation label |
| 70 | +_C.TRAIN.segm_downsampling_rate = 8 |
| 71 | +# if horizontally flip images when training |
| 72 | +_C.TRAIN.random_flip = True |
| 73 | + |
| 74 | +# folder to output checkpoints |
| 75 | +_C.TRAIN.ckpt = "./ckpt" |
| 76 | +# frequency to display |
| 77 | +_C.TRAIN.disp_iter = 20 |
| 78 | +# manual seed |
| 79 | +_C.TRAIN.seed = 304 |
| 80 | + |
| 81 | +# ----------------------------------------------------------------------------- |
| 82 | +# Testing |
| 83 | +# ----------------------------------------------------------------------------- |
| 84 | +_C.TEST = CN() |
0 commit comments