_base_: '../_base_/cityscapes.yml'

batch_size: 1
iters: 150000

train_dataset:
  transforms:
    - type: ResizeStepScaling
      min_scale_factor: 0.5
      max_scale_factor: 2.0
      scale_step_size: 0
    - type: RandomPaddingCrop
      crop_size: [2048, 1024]
    - type: RandomHorizontalFlip
    - type: RandomDistort
      brightness_range: 0.25
      brightness_prob: 1
      contrast_range: 0.25
      contrast_prob: 1
      saturation_range: 0.25
      saturation_prob: 1
      hue_range: 0.25
      hue_prob: 1
    - type: RandomScaleAspect
    - type: Normalize
      mean: [0.485, 0.456, 0.406]
      std: [0.229, 0.224, 0.225]
  mode: train

val_dataset:
  transforms:
    - type: Normalize
      mean: [0.485, 0.456, 0.406]
      std: [0.229, 0.224, 0.225]
  mode: val

export:
  transforms:
    - type: Normalize
      mean: [0.485, 0.456, 0.406]
      std: [0.229, 0.224, 0.225]

model:
    type: MscaleOCRNet
    num_classes: 19
    backbone: 
      type: HRNet_W48
      use_psa: True
      padding_same: False
    pretrained: https://paddleseg.bj.bcebos.com/dygraph/cityscapes/mscale_ocrnet_hrnetv2_psa_cityscapes_1024x2048_150k/mscale_ocrnet_pretrained_mappilary.zip

optimizer:
  type: sgd
  momentum: 0.9
  weight_decay: 5.0e-4

lr_scheduler:
  type: PolynomialDecay
  learning_rate: 0.005
  end_lr: 0.0
  power: 2
  warmup_iters: 5000
  warmup_start_lr: 1.0e-5

loss:
  types:
    - type: CrossEntropyLoss
    - type: MixedLoss
      losses:
        - type: RMILoss
        - type: CrossEntropyLoss
      coef: [1.0, 1.0]
    - type: CrossEntropyLoss
    - type: CrossEntropyLoss
  coef: [0.4, 1.0, 0.05, 0.05]
