det_r50_vd_pse.yml 3.3 KB
Newer Older
W
WenmuZhou 已提交
1 2 3 4 5 6
Global:
  use_gpu: true
  epoch_num: 600
  log_smooth_window: 20
  print_batch_step: 10
  save_model_dir: ./output/det_r50_vd_pse/
W
WenmuZhou 已提交
7 8 9
  save_epoch_step: 600
  # evaluation is run every 125 iterations
  eval_batch_step: [ 0,125 ]
W
WenmuZhou 已提交
10
  cal_metric_during_train: False
W
WenmuZhou 已提交
11
  pretrained_model: ./pretrain_models/ResNet50_vd_ssld_pretrained
W
WenmuZhou 已提交
12 13 14 15
  checkpoints: #./output/det_r50_vd_pse_batch8_ColorJitter/best_accuracy
  save_inference_dir:
  use_visualdl: False
  infer_img: doc/imgs_en/img_10.jpg
W
WenmuZhou 已提交
16
  save_res_path: ./output/det_pse/predicts_pse.txt
W
WenmuZhou 已提交
17 18 19 20 21 22

Architecture:
  model_type: det
  algorithm: PSE
  Transform:
  Backbone:
W
add yml  
wangjingyeye 已提交
23
    name: ResNet_vd
W
WenmuZhou 已提交
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
    layers: 50
  Neck:
    name: FPN
    out_channels: 256
  Head:
    name: PSEHead
    hidden_dim: 256
    out_channels: 7

Loss:
  name: PSELoss
  alpha: 0.7
  ohem_ratio: 3
  kernel_sample_mask: pred
  reduction: none

Optimizer:
  name: Adam
  beta1: 0.9
  beta2: 0.999
  lr:
    name: Step
    learning_rate: 0.0001
    step_size: 200
    gamma: 0.1
  regularizer:
    name: 'L2'
    factor: 0.0005

PostProcess:
  name: PSEPostProcess
  thresh: 0
  box_thresh: 0.85
  min_area: 16
文幕地方's avatar
文幕地方 已提交
58
  box_type: quad # 'quad' or 'poly'
W
WenmuZhou 已提交
59 60 61 62 63 64 65 66 67 68 69 70
  scale: 1

Metric:
  name: DetMetric
  main_indicator: hmean

Train:
  dataset:
    name: SimpleDataSet
    data_dir: ./train_data/icdar2015/text_localization/
    label_file_list:
      - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
W
WenmuZhou 已提交
71
    ratio_list: [ 1.0 ]
W
WenmuZhou 已提交
72 73 74 75 76 77 78 79 80 81 82 83
    transforms:
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
      - DetLabelEncode: # Class handling label
      - ColorJitter:
          brightness: 0.12549019607843137
          saturation: 0.5
      - IaaAugment:
          augmenter_args:
            - { 'type': Resize, 'args': { 'size': [ 0.5, 3 ] } }
            - { 'type': Fliplr, 'args': { 'p': 0.5 } }
W
WenmuZhou 已提交
84
            - { 'type': Affine, 'args': { 'rotate': [ -10, 10 ] } }
W
WenmuZhou 已提交
85 86 87 88 89
      - MakePseGt:
          kernel_num: 7
          min_shrink_ratio: 0.4
          size: 640
      - RandomCropImgMask:
W
WenmuZhou 已提交
90
          size: [ 640,640 ]
W
WenmuZhou 已提交
91
          main_key: gt_text
W
WenmuZhou 已提交
92
          crop_keys: [ 'image', 'gt_text', 'gt_kernels', 'mask' ]
W
WenmuZhou 已提交
93 94
      - NormalizeImage:
          scale: 1./255.
W
WenmuZhou 已提交
95 96
          mean: [ 0.485, 0.456, 0.406 ]
          std: [ 0.229, 0.224, 0.225 ]
W
WenmuZhou 已提交
97 98 99
          order: 'hwc'
      - ToCHWImage:
      - KeepKeys:
W
WenmuZhou 已提交
100
          keep_keys: [ 'image', 'gt_text', 'gt_kernels', 'mask' ] # the order of the dataloader list
W
WenmuZhou 已提交
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
  loader:
    shuffle: True
    drop_last: False
    batch_size_per_card: 8
    num_workers: 8

Eval:
  dataset:
    name: SimpleDataSet
    data_dir: ./train_data/icdar2015/text_localization/
    label_file_list:
      - ./train_data/icdar2015/text_localization/test_icdar2015_label.txt
    ratio_list: [ 1.0 ]
    transforms:
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
      - DetLabelEncode: # Class handling label
      - DetResizeForTest:
          limit_side_len: 736
          limit_type: min
      - NormalizeImage:
          scale: 1./255.
W
WenmuZhou 已提交
124 125
          mean: [ 0.485, 0.456, 0.406 ]
          std: [ 0.229, 0.224, 0.225 ]
W
WenmuZhou 已提交
126 127 128
          order: 'hwc'
      - ToCHWImage:
      - KeepKeys:
W
WenmuZhou 已提交
129
          keep_keys: [ 'image', 'shape', 'polys', 'ignore_tags' ]
W
WenmuZhou 已提交
130 131 132 133 134
  loader:
    shuffle: False
    drop_last: False
    batch_size_per_card: 1 # must be 1
    num_workers: 8