rec_resnet_stn_bilstm_att.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. Global:
  2. use_gpu: True
  3. epoch_num: 6
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/rec/seed
  7. save_epoch_step: 3
  8. # evaluation is run every 5000 iterations after the 4000th iteration
  9. eval_batch_step: [0, 2000]
  10. cal_metric_during_train: True
  11. pretrained_model:
  12. checkpoints:
  13. save_inference_dir:
  14. use_visualdl: False
  15. infer_img: doc/imgs_words_en/word_10.png
  16. # for data or label process
  17. character_dict_path: ppocr/utils/EN_symbol_dict.txt
  18. max_text_length: 100
  19. infer_mode: False
  20. use_space_char: False
  21. save_res_path: ./output/rec/predicts_seed.txt
  22. Optimizer:
  23. name: Adadelta
  24. weight_deacy: 0.0
  25. momentum: 0.9
  26. lr:
  27. name: Piecewise
  28. decay_epochs: [4, 5]
  29. values: [1.0, 0.1, 0.01]
  30. regularizer:
  31. name: 'L2'
  32. factor: 2.0e-05
  33. Architecture:
  34. model_type: rec
  35. algorithm: SEED
  36. Transform:
  37. name: STN_ON
  38. tps_inputsize: [32, 64]
  39. tps_outputsize: [32, 100]
  40. num_control_points: 20
  41. tps_margins: [0.05,0.05]
  42. stn_activation: none
  43. Backbone:
  44. name: ResNet_ASTER
  45. Head:
  46. name: AsterHead # AttentionHead
  47. sDim: 512
  48. attDim: 512
  49. max_len_labels: 100
  50. Loss:
  51. name: AsterLoss
  52. PostProcess:
  53. name: SEEDLabelDecode
  54. Metric:
  55. name: RecMetric
  56. main_indicator: acc
  57. is_filter: True
  58. Train:
  59. dataset:
  60. name: LMDBDataSet
  61. data_dir: ./train_data/data_lmdb_release/training/
  62. transforms:
  63. - Fasttext:
  64. path: "./cc.en.300.bin"
  65. - DecodeImage: # load image
  66. img_mode: BGR
  67. channel_first: False
  68. - SEEDLabelEncode: # Class handling label
  69. - RecResizeImg:
  70. character_dict_path:
  71. image_shape: [3, 64, 256]
  72. padding: False
  73. - KeepKeys:
  74. keep_keys: ['image', 'label', 'length', 'fast_label'] # dataloader will return list in this order
  75. loader:
  76. shuffle: True
  77. batch_size_per_card: 256
  78. drop_last: True
  79. num_workers: 6
  80. Eval:
  81. dataset:
  82. name: LMDBDataSet
  83. data_dir: ./train_data/data_lmdb_release/evaluation/
  84. transforms:
  85. - DecodeImage: # load image
  86. img_mode: BGR
  87. channel_first: False
  88. - SEEDLabelEncode: # Class handling label
  89. - RecResizeImg:
  90. character_dict_path:
  91. image_shape: [3, 64, 256]
  92. padding: False
  93. - KeepKeys:
  94. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  95. loader:
  96. shuffle: False
  97. drop_last: True
  98. batch_size_per_card: 256
  99. num_workers: 4