e2e_r50_vd_pg.yml 3.0 KB
Newer Older
J
Jethong 已提交
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
Global:
  use_gpu: False
  epoch_num: 600
  log_smooth_window: 20
  print_batch_step: 2
  save_model_dir: ./output/pg_r50_vd_tt/
  save_epoch_step: 1
  # evaluation is run every 5000 iterationss after the 4000th iteration
  eval_batch_step: [ 0, 1000 ]
  # if pretrained_model is saved in static mode, load_static_weights must set to True
  load_static_weights: False
  cal_metric_during_train: False
  pretrained_model:
  checkpoints:
  save_inference_dir:
  use_visualdl: False
  infer_img:
  save_res_path: ./output/pg_r50_vd_tt/predicts_pg.txt

Architecture:
  model_type: e2e
  algorithm: PG
  Transform:
  Backbone:
    name: ResNet
    layers: 50
  Neck:
    name: PGFPN
    model_name: large
  Head:
    name: PGHead
    model_name: large

Loss:
  name: PGLoss

#Optimizer:
#  name: Adam
#  beta1: 0.9
#  beta2: 0.999
#  lr:
#    name: Cosine
#    learning_rate: 0.001
#    warmup_epoch: 1
#  regularizer:
#    name: 'L2'
#    factor: 0

Optimizer:
  name: RMSProp
  lr:
    name: Piecewise
    learning_rate: 0.001
    decay_epochs: [ 40, 80, 120, 160, 200 ]
    values: [ 0.001, 0.00033, 0.0001, 0.000033, 0.00001 ]
  regularizer:
    name: 'L2'
    factor: 0.00005

PostProcess:
  name: PGPostProcess
  score_thresh: 0.8
  cover_thresh: 0.1
  nms_thresh: 0.2

Metric:
  name: E2EMetric
J
Jethong 已提交
68
  main_indicator: f_score_e2e
J
Jethong 已提交
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

Train:
  dataset:
    name: PGDateSet
    label_file_list:
    ratio_list:
    data_format: textnet  # textnet/partvgg
    Lexicon_Table: [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ]
    transforms:
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
      - PGProcessTrain:
          batch_size: 14
          data_format: icdar
          tcl_len: 64
          min_crop_size: 24
          min_text_size: 4
          max_text_size: 512
      - KeepKeys:
          keep_keys: [ 'images', 'tcl_maps', 'tcl_label_maps', 'border_maps','direction_maps', 'training_masks', 'label_list', 'pos_list', 'pos_mask' ] # dataloader will return list in this order
  loader:
    shuffle: True
    drop_last: True
    batch_size_per_card: 1
    num_workers: 8

Eval:
  dataset:
    name: PGDateSet
    data_dir: ./train_data/
    label_file_list:
    transforms:
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
      - E2ELabelEncode:
          label_list: [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ]
      - E2EResizeForTest:
          valid_set: totaltext
          max_side_len: 768
      - NormalizeImage:
          scale: 1./255.
          mean: [ 0.485, 0.456, 0.406 ]
          std: [ 0.229, 0.224, 0.225 ]
          order: 'hwc'
      - ToCHWImage:
      - KeepKeys:
          keep_keys: [ 'image', 'shape', 'polys', 'strs', 'tags' ]
  loader:
    shuffle: False
    drop_last: False
    batch_size_per_card: 1 # must be 1
    num_workers: 2