_base_ = [
    '../_base_/models/icnet_r50-d8.py',
    '../_base_/datasets/publicdataset_dresden.py',
    '../_base_/default_runtime.py',
    '../_base_/schedules/schedule_300e_val1_check10.py',
]

norm_cfg = dict(
    type='BN',
)

crop_size = (512, 512)

data_preprocessor = dict(
    size=(512, 512),
    mean=[
        103.172638338208,
        61.44762740851152,
        51.407770213021976,
    ],
    std=[
        75.77031253622098,
        54.63616729031377,
        49.45572239497569,
    ],
    bgr_to_rgb=False,
)

model = dict(
    backbone=dict(
        backbone_cfg=dict(
            depth=50,
            init_cfg=dict(
                type='Pretrained',
                checkpoint='./My_Local_Model/open_mmlab/resnet50_v1c.pth',
            ),
        ),
        layer_channels=(512, 2048),
        norm_cfg=dict(
            type='BN',
        ),
        align_corners=False,
    ),
    data_preprocessor=dict(
        size=(512, 512),
        mean=[
            103.172638338208,
            61.44762740851152,
            51.407770213021976,
        ],
        std=[
            75.77031253622098,
            54.63616729031377,
            49.45572239497569,
        ],
        bgr_to_rgb=False,
    ),
    decode_head=dict(
        num_classes=11,
        loss_decode=dict(
            type='DiceLoss',
            use_sigmoid=False,
            loss_weight=1.0,
        ),
        align_corners=False,
    ),
    auxiliary_head=[
        dict(
            type='FCNHead',
            in_channels=128,
            channels=128,
            num_convs=1,
            num_classes=11,
            in_index=0,
            norm_cfg=dict(
                type='SyncBN',
                requires_grad=True,
            ),
            concat_input=False,
            align_corners=False,
            loss_decode=dict(
                type='DiceLoss',
                use_sigmoid=False,
                loss_weight=0.4,
            ),
        ),
        dict(
            type='FCNHead',
            in_channels=128,
            channels=128,
            num_convs=1,
            num_classes=11,
            in_index=1,
            norm_cfg=dict(
                type='SyncBN',
                requires_grad=True,
            ),
            concat_input=False,
            align_corners=False,
            loss_decode=dict(
                type='DiceLoss',
                use_sigmoid=False,
                loss_weight=0.4,
            ),
        ),
    ],
)

test_cfg = dict(
    crop_size=(512, 512),
)

optim_wrapper = dict(
    type='OptimWrapper',
    _delete_=True,
    optimizer=dict(
        type='AdamW',
        lr=0.0001,
        weight_decay=0.0005,
    ),
    clip_grad=dict(
        max_norm=1,
        norm_type=2,
    ),
)

param_scheduler = [
    dict(
        type='LinearLR',
        start_factor=1e-06,
        by_epoch=True,
        begin=0,
        end=10,
    ),
    dict(
        type='PolyLR',
        power=0.9,
        begin=10,
        end=300,
        eta_min=1e-05,
        by_epoch=True,
    ),
]

