fcos_r50_fpn_1x_dcn.yml 3.6 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 171 172 173 174 175 176 177 178 179 180 181 182
architecture: FCOS
max_iters: 90000
use_gpu: true
snapshot_iter: 5000
log_smooth_window: 20
log_iter: 20
save_dir: output
pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_cos_pretrained.tar
metric: COCO
weights: output/fcos_r50_fpn_1x/model_final
num_classes: 81

FCOS:
  backbone: ResNet
  fpn: FPN
  fcos_head: FCOSHead

ResNet:
  norm_type: affine_channel
  norm_decay: 0.
  depth: 50
  feature_maps: [3, 4, 5]
  freeze_at: 2
  dcn_v2_stages: [3, 4, 5]

FPN:
  min_level: 3
  max_level: 7
  num_chan: 256
  use_c5: false
  spatial_scale: [0.03125, 0.0625, 0.125]
  has_extra_convs: true

FCOSHead:
  num_classes: 81
  fpn_stride: [8, 16, 32, 64, 128]
  num_convs: 4
  norm_type: "gn"
  fcos_loss: FCOSLoss
  norm_reg_targets: True
  centerness_on_reg: True
  use_dcn_in_tower: True
  nms: MultiClassNMS

MultiClassNMS:
  score_threshold: 0.025
  nms_top_k: 1000
  keep_top_k: 100
  nms_threshold: 0.6
  background_label: -1

FCOSLoss:
  loss_alpha: 0.25
  loss_gamma: 2.0
  iou_loss_type: "giou"
  reg_weights: 1.0

LearningRate:
  base_lr: 0.01
  schedulers:
  - !PiecewiseDecay
    gamma: 0.1
    milestones: [60000, 80000]
  - !LinearWarmup
    start_factor: 0.3333333333333333
    steps: 500

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

TrainReader:
  inputs_def:
    fields: ['image', 'gt_bbox', 'gt_class', 'gt_score', 'im_info']
  dataset:
    !COCODataSet
    image_dir: train2017
    anno_path: annotations/instances_train2017.json
    dataset_dir: dataset/coco
    with_background: true
  sample_transforms:
  - !DecodeImage
    to_rgb: true
  - !RandomFlipImage
    prob: 0.5
  - !NormalizeImage
    is_channel_first: false
    is_scale: true
    mean: [0.485,0.456,0.406]
    std: [0.229, 0.224,0.225]
  - !ResizeImage
    target_size: 800
    max_size: 1333
    interp: 1
    use_cv2: true
  - !Permute
    to_bgr: false
    channel_first: true
  batch_transforms:
  - !PadBatch
    pad_to_stride: 128
    use_padded_im_info: false
  - !Gt2FCOSTarget
    object_sizes_boundary: [64, 128, 256, 512]
    center_sampling_radius: 1.5
    downsample_ratios: [8, 16, 32, 64, 128]
    norm_reg_targets: True
  batch_size: 2
  shuffle: true
  worker_num: 16
  use_process: false

EvalReader:
  inputs_def:
    fields: ['image', 'im_id', 'im_shape', 'im_info']
  dataset:
    !COCODataSet
    image_dir: val2017
    anno_path: annotations/instances_val2017.json
    dataset_dir: dataset/coco
    with_background: false
  sample_transforms:
  - !DecodeImage
    to_rgb: true
    with_mixup: false
  - !NormalizeImage
    is_channel_first: false
    is_scale: true
    mean: [0.485,0.456,0.406]
    std: [0.229, 0.224,0.225]
  - !ResizeImage
    target_size: 800
    max_size: 1333
    interp: 1
    use_cv2: true
  - !Permute
    channel_first: true
    to_bgr: false
  batch_transforms:
  - !PadBatch
    pad_to_stride: 128
    use_padded_im_info: true
  batch_size: 8
  shuffle: false
  worker_num: 2
  use_process: false

TestReader:
  inputs_def:
    # set image_shape if needed
    fields: ['image', 'im_id', 'im_shape', 'im_info']
  dataset:
    !ImageFolder
    anno_path: annotations/instances_val2017.json
    with_background: false
  sample_transforms:
  - !DecodeImage
    to_rgb: true
    with_mixup: false
  - !NormalizeImage
    is_channel_first: false
    is_scale: true
    mean: [0.485,0.456,0.406]
    std: [0.229, 0.224,0.225]
  - !ResizeImage
    interp: 1
    max_size: 1333
    target_size: 800
    use_cv2: true
  - !Permute
    channel_first: true
    to_bgr: false
  batch_transforms:
  - !PadBatch
    pad_to_stride: 128
    use_padded_im_info: true
  batch_size: 1
  shuffle: false