pafnet_10x_coco.yml 3.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
architecture: TTFNet
use_gpu: true
max_iters: 150000
log_smooth_window: 20
save_dir: output
snapshot_iter: 10000
metric: COCO
pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_vd_ssld_pretrained.tar
weights: output/pafnet_10x_coco/model_final
num_classes: 80
use_ema: true
ema_decay: 0.9998

TTFNet:
  backbone: ResNet
  ttf_head: TTFHead

ResNet:
  norm_type: sync_bn
  freeze_at: 0
  freeze_norm: false
  norm_decay: 0.
  depth: 50
  feature_maps: [2, 3, 4, 5]
  variant: d
  dcn_v2_stages: [3, 4, 5]

TTFHead:
  head_conv: 128
  wh_conv: 64
  hm_head_conv_num: 2
  wh_head_conv_num: 2
  wh_offset_base: 16
  wh_loss: GiouLoss
  dcn_head: True

GiouLoss:
  loss_weight: 5.
  do_average: false
  use_class_weight: false

LearningRate:
  base_lr: 0.015
  schedulers:
  - !PiecewiseDecay
    gamma: 0.1
    milestones:
    - 112500
    - 137500
  - !LinearWarmup
    start_factor: 0.2
    steps: 500

OptimizerBuilder:
  optimizer:
    momentum: 0.9
    type: Momentum
  regularizer:
    factor: 0.0004
    type: L2

TrainReader:
  inputs_def:
    fields: ['image', 'ttf_heatmap', 'ttf_box_target', 'ttf_reg_weight']
  dataset:
    !COCODataSet
    image_dir: train2017
    anno_path: annotations/instances_train2017.json
    dataset_dir: dataset/coco
    with_background: false
  sample_transforms:
  - !DecodeImage
    to_rgb: true
    with_cutmix: True
  - !CutmixImage
    alpha: 1.5
    beta: 1.5
  - !ColorDistort
    hue: [-18., 18., 0.5]
    saturation: [0.5, 1.5, 0.5]
    contrast: [0.5, 1.5, 0.5]
    brightness: [-32., 32., 0.5]
    random_apply: False
    hsv_format: True
    random_channel: True
  - !RandomExpand
    ratio: 4
    prob: 0.5
    fill_value: [123.675, 116.28, 103.53]
  - !RandomCrop
    aspect_ratio: NULL
    cover_all_box: True
  - !RandomFlipImage
    prob: 0.5
  batch_transforms:
  - !RandomShape
    sizes: [416, 448, 480, 512, 544, 576, 608, 640, 672]
    random_inter: True
    resize_box: True
  - !NormalizeImage
    is_channel_first: false
    is_scale: false
    mean: [123.675, 116.28, 103.53]
    std: [58.395, 57.12, 57.375]
  - !Permute
    to_bgr: false
    channel_first: true
  - !Gt2TTFTarget
    num_classes: 80
    down_ratio: 4
  - !PadBatch
    pad_to_stride: 32
  batch_size: 12
  shuffle: true
  worker_num: 8
  bufsize: 2
  use_process: false
  cutmix_epoch: 100

EvalReader:
  inputs_def:
    image_shape: [3, 512, 512]
    fields: ['image', 'im_id', 'scale_factor']
  dataset:
    !COCODataSet
      image_dir: val2017
      anno_path: annotations/instances_val2017.json
      dataset_dir: dataset/coco
      with_background: false
  sample_transforms:
    - !DecodeImage
      to_rgb: True
    - !Resize
      target_dim: 512
    - !NormalizeImage
      mean: [123.675, 116.28, 103.53]
      std: [58.395, 57.12, 57.375]
      is_scale: false
      is_channel_first: false
    - !Permute
      to_bgr: false
      channel_first: True
  batch_size: 1
  drop_empty: false
  worker_num: 8
  bufsize: 16

TestReader:
  inputs_def:
    image_shape: [3, 512, 512]
    fields: ['image', 'im_id', 'scale_factor']
  dataset:
    !ImageFolder
      anno_path: annotations/instances_val2017.json
      with_background: false
  sample_transforms:
    - !DecodeImage
      to_rgb: True
    - !Resize
      interp: 1
      target_dim: 512
    - !NormalizeImage
      mean: [123.675, 116.28, 103.53]
      std: [58.395, 57.12, 57.375]
      is_scale: false
      is_channel_first: false
    - !Permute
      to_bgr: false
      channel_first: True
  batch_size: 1