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

crop_size = (512, 1024)

data_preprocessor = dict(
    size=(512, 1024),
    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,
    ),
    data_preprocessor=dict(
        size=(512, 1024),
        mean=[
            94.94709810464303,
            61.72942233949928,
            75.93763705236906,
        ],
        std=[
            44.005506081132594,
            42.69595666984776,
            44.99354156225523,
        ],
        bgr_to_rgb=False,
    ),
    decode_head=dict(
        num_classes=36,
        loss_decode=dict(
            type='DiceLoss',
            use_sigmoid=False,
            loss_weight=1.0,
        ),
        align_corners=True,
    ),
    auxiliary_head=dict(
        num_classes=36,
        loss_decode=dict(
            type='DiceLoss',
            use_sigmoid=False,
            loss_weight=0.4,
        ),
        align_corners=True,
    ),
)

test_cfg = dict(
    mode='slide',
    crop_size=(512, 1024),
    stride=(341, 682),
)

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=1.0,
        begin=1500,
        end=160000,
        eta_min=0.0,
        by_epoch=False,
    ),
]

