'''mcibiplusplus_aspp_hrnetv2w48_cityscapes''' import os from .._base_ import REGISTERED_SEGMENTOR_CONFIGS, REGISTERED_DATASET_CONFIGS, REGISTERED_DATALOADER_CONFIGS # deepcopy SEGMENTOR_CFG = REGISTERED_SEGMENTOR_CONFIGS['MCIBIPLUSPLUS_SEGMENTOR_CFG'].copy() # modify dataset config SEGMENTOR_CFG['dataset'] = REGISTERED_DATASET_CONFIGS['DATASET_CFG_CITYSCAPES_512x1024'].copy() SEGMENTOR_CFG['dataset']['train']['set'] = 'trainval' SEGMENTOR_CFG['dataset']['test']['set'] = 'test' # modify dataloader config SEGMENTOR_CFG['dataloader'] = REGISTERED_DATALOADER_CONFIGS['DATALOADER_CFG_BS16'].copy() # modify scheduler config SEGMENTOR_CFG['scheduler']['max_epochs'] = 440 # modify other segmentor configs SEGMENTOR_CFG['num_classes'] = 19 SEGMENTOR_CFG['backbone'] = { 'type': 'HRNet', 'structure_type': 'hrnetv2_w48', 'arch': 'hrnetv2_w48', 'pretrained': True, 'selected_indices': (0, 0, 0, 0), 'mcibi_version': True, } SEGMENTOR_CFG['head']['decoder'] = { 'pr': {'in_channels': 512, 'out_channels': 512, 'dropout': 0.1}, 'cwi': {'in_channels': 512, 'out_channels': 512, 'dropout': 0.1, 'kernel_size': 3, 'padding': 1}, 'cls': {'in_channels': 1024, 'out_channels': 512, 'dropout': 0.1, 'kernel_size': 3, 'padding': 1}, } SEGMENTOR_CFG['head']['downsample_before_sa'] = True SEGMENTOR_CFG['head']['in_channels'] = sum([48, 96, 192, 384]) SEGMENTOR_CFG['head']['context_within_image']['is_on'] = True SEGMENTOR_CFG['head']['context_within_image']['use_self_attention'] = False SEGMENTOR_CFG['auxiliary'] = None SEGMENTOR_CFG['losses'].pop('loss_aux') SEGMENTOR_CFG['inference'] = { 'forward': {'mode': 'slide', 'cropsize': (1024, 512), 'stride': (341, 341)}, 'tta': {'multiscale': [0.5, 0.75, 1.0, 1.25, 1.5, 1.75], 'flip': True, 'use_probs_before_resize': True}, 'evaluate': {'metric_list': ['iou', 'miou']}, } SEGMENTOR_CFG['work_dir'] = os.path.split(__file__)[-1].split('.')[0] SEGMENTOR_CFG['logger_handle_cfg']['logfilepath'] = os.path.join(SEGMENTOR_CFG['work_dir'], f"{os.path.split(__file__)[-1].split('.')[0]}.log")