rec_resnet_rfl_att.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. Global:
  2. use_gpu: True
  3. epoch_num: 6
  4. log_smooth_window: 20
  5. print_batch_step: 50
  6. save_model_dir: ./output/rec/rec_resnet_rfl_att/
  7. save_epoch_step: 1
  8. # evaluation is run every 5000 iterations after the 4000th iteration
  9. eval_batch_step: [0, 5000]
  10. cal_metric_during_train: True
  11. pretrained_model: ./pretrain_models/rec_resnet_rfl_visual/best_accuracy.pdparams
  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:
  18. max_text_length: 25
  19. infer_mode: False
  20. use_space_char: False
  21. save_res_path: ./output/rec/rec_resnet_rfl.txt
  22. Optimizer:
  23. name: AdamW
  24. beta1: 0.9
  25. beta2: 0.999
  26. weight_decay: 0.0
  27. clip_norm_global: 5.0
  28. lr:
  29. name: Piecewise
  30. decay_epochs : [3, 4, 5]
  31. values : [0.001, 0.0003, 0.00009, 0.000027]
  32. Architecture:
  33. model_type: rec
  34. algorithm: RFL
  35. in_channels: 1
  36. Transform:
  37. name: TPS
  38. num_fiducial: 20
  39. loc_lr: 1.0
  40. model_name: large
  41. Backbone:
  42. name: ResNetRFL
  43. use_cnt: True
  44. use_seq: True
  45. Neck:
  46. name: RFAdaptor
  47. use_v2s: True
  48. use_s2v: True
  49. Head:
  50. name: RFLHead
  51. in_channels: 512
  52. hidden_size: 256
  53. batch_max_legnth: 25
  54. out_channels: 38
  55. use_cnt: True
  56. use_seq: True
  57. Loss:
  58. name: RFLLoss
  59. # ignore_index: 0
  60. PostProcess:
  61. name: RFLLabelDecode
  62. Metric:
  63. name: RecMetric
  64. main_indicator: acc
  65. Train:
  66. dataset:
  67. name: LMDBDataSet
  68. data_dir: ./train_data/data_lmdb_release/training
  69. transforms:
  70. - DecodeImage: # load image
  71. img_mode: BGR
  72. channel_first: False
  73. - RFLLabelEncode: # Class handling label
  74. - RFLRecResizeImg:
  75. image_shape: [1, 32, 100]
  76. padding: false
  77. interpolation: 2
  78. - KeepKeys:
  79. keep_keys: ['image', 'label', 'length', 'cnt_label'] # dataloader will return list in this order
  80. loader:
  81. shuffle: True
  82. batch_size_per_card: 64
  83. drop_last: True
  84. num_workers: 8
  85. Eval:
  86. dataset:
  87. name: LMDBDataSet
  88. data_dir: ./train_data/data_lmdb_release/validation/
  89. transforms:
  90. - DecodeImage: # load image
  91. img_mode: BGR
  92. channel_first: False
  93. - RFLLabelEncode: # Class handling label
  94. - RFLRecResizeImg:
  95. image_shape: [1, 32, 100]
  96. padding: false
  97. interpolation: 2
  98. - KeepKeys:
  99. keep_keys: ['image', 'label', 'length', 'cnt_label'] # dataloader will return list in this order
  100. loader:
  101. shuffle: False
  102. drop_last: False
  103. batch_size_per_card: 256
  104. num_workers: 8