_base_ = [
    '../_base_/models/deeplabv3plus_r50-d8.py',
    '../_base_/datasets/my_dataset_model.py',
    '../_base_/default_runtime.py',
    '../_base_/schedules/schedule_40k_check_4000.py',
]

norm_cfg = dict(
    type='BN',
)

crop_size = (512, 512)

data_preprocessor = dict(
    size=(512, 512),
    mean=[
        94.94709810464303,
        61.72942233949928,
        75.93763705236906,
    ],
    std=[
        44.005506081132594,
        42.69595666984776,
        44.99354156225523,
    ],
    bgr_to_rgb=False,
)

model = dict(
    pretrained='./My_Local_Model/open_mmlab/resnet101_v1c.pth',
    backbone=dict(
        depth=101,
        type='ResNetV1c',
        dilations=(1, 1, 1, 2),
        strides=(1, 2, 2, 1),
        multi_grid=(1, 2, 4),
    ),
    data_preprocessor=dict(
        size=(512, 512),
        mean=[
            94.94709810464303,
            61.72942233949928,
            75.93763705236906,
        ],
        std=[
            44.005506081132594,
            42.69595666984776,
            44.99354156225523,
        ],
        bgr_to_rgb=False,
    ),
    decode_head=dict(
        sampler=dict(
            type='OHEMPixelSampler',
            thresh=0.7,
            min_kept=10000,
        ),
        dilations=(1, 6, 12, 18),
        c1_in_channels=256,
        c1_channels=48,
        in_channels=2048,
        channels=512,
        num_classes=36,
        loss_decode=dict(
            type='DiceLoss',
            use_sigmoid=False,
            loss_weight=1.0,
        ),
        align_corners=False,
        norm_cfg=dict(
            type='BN',
        ),
    ),
    auxiliary_head=dict(
        in_channels=1024,
        channels=256,
        num_classes=36,
        loss_decode=dict(
            type='DiceLoss',
            use_sigmoid=False,
            loss_weight=1.0,
        ),
        align_corners=False,
        norm_cfg=dict(
            type='BN',
        ),
    ),
)

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=False,
        begin=0,
        end=1500,
    ),
    dict(
        type='PolyLR',
        power=0.9,
        begin=1500,
        end=40000,
        eta_min=1e-05,
        by_epoch=False,
    ),
]

