rec_resnet_stn_bilstm_att.yml 2.4 KB
Newer Older
T
tink2123 已提交
1
Global:
T
tink2123 已提交
2
  use_gpu: True
T
tink2123 已提交
3 4 5
  epoch_num: 400
  log_smooth_window: 20
  print_batch_step: 10
T
tink2123 已提交
6
  save_model_dir: ./output/rec/seed
T
tink2123 已提交
7 8 9 10 11 12 13 14
  save_epoch_step: 3
  # evaluation is run every 5000 iterations after the 4000th iteration
  eval_batch_step: [0, 2000]
  cal_metric_during_train: True
  pretrained_model:
  checkpoints:
  save_inference_dir:
  use_visualdl: False
T
tink2123 已提交
15
  infer_img: doc/imgs_words_en/word_10.png
T
tink2123 已提交
16 17 18
  # for data or label process
  character_dict_path: 
  character_type: EN_symbol
T
tink2123 已提交
19
  max_text_length: 100
T
tink2123 已提交
20 21
  infer_mode: False
  use_space_char: False
T
tink2123 已提交
22
  save_res_path: ./output/rec/predicts_seed.txt
T
tink2123 已提交
23 24 25


Optimizer:
T
tink2123 已提交
26 27 28
  name: Adadelta
  weight_deacy: 0.0
  momentum: 0.9
T
tink2123 已提交
29
  lr:
T
tink2123 已提交
30 31 32
    name: Piecewise
    decay_epochs: [4,5,8]
    values: [1.0, 0.1, 0.01]
T
tink2123 已提交
33 34
  regularizer:
    name: 'L2'
T
tink2123 已提交
35 36
    factor: 2.0e-05

T
tink2123 已提交
37 38

Architecture:
T
tink2123 已提交
39
  model_type: rec
T
tink2123 已提交
40
  algorithm: SEED
T
tink2123 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
  Transform:
    name: STN_ON
    tps_inputsize: [32, 64]
    tps_outputsize: [32, 100]
    num_control_points: 20
    tps_margins: [0.05,0.05]
    stn_activation: none
  Backbone:
    name: ResNet_ASTER
  Head:
    name: AsterHead  # AttentionHead
    sDim: 512
    attDim: 512
    max_len_labels: 100

Loss:
  name: AsterLoss

PostProcess:
T
tink2123 已提交
60
  name: SEEDLabelDecode
T
tink2123 已提交
61 62 63 64

Metric:
  name: RecMetric
  main_indicator: acc
T
tink2123 已提交
65
  is_filter: True
T
tink2123 已提交
66 67 68

Train:
  dataset:
T
tink2123 已提交
69 70
    name: LMDBDataSet
    data_dir: ./train_data/data_lmdb_release/training/
T
tink2123 已提交
71
    transforms:
T
tink2123 已提交
72 73
      - Fasttext:
          path: "./cc.en.300.bin"
T
tink2123 已提交
74 75 76
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
T
tink2123 已提交
77
      - SEEDLabelEncode: # Class handling label
T
tink2123 已提交
78 79
      - RecResizeImg:
          character_type: en
T
tink2123 已提交
80
          image_shape: [3, 64, 256]
T
tink2123 已提交
81
          padding: False
T
tink2123 已提交
82
      - KeepKeys:
T
tink2123 已提交
83
          keep_keys: ['image', 'label', 'length', 'fast_label'] # dataloader will return list in this order
T
tink2123 已提交
84 85
  loader:
    shuffle: True
T
tink2123 已提交
86
    batch_size_per_card: 256
T
tink2123 已提交
87
    drop_last: True
T
tink2123 已提交
88
    num_workers: 6
T
tink2123 已提交
89 90 91

Eval:
  dataset:
T
tink2123 已提交
92 93
    name: LMDBDataSet
    data_dir: ./train_data/data_lmdb_release/evaluation/
T
tink2123 已提交
94 95 96 97
    transforms:
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
T
tink2123 已提交
98
      - SEEDLabelEncode: # Class handling label
T
tink2123 已提交
99 100
      - RecResizeImg:
          character_type: en
T
tink2123 已提交
101
          image_shape: [3, 64, 256]
T
tink2123 已提交
102
          padding: False
T
tink2123 已提交
103 104 105 106
      - KeepKeys:
          keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  loader:
    shuffle: False
T
tink2123 已提交
107 108 109
    drop_last: True
    batch_size_per_card: 256
    num_workers: 4