rec_r32_gaspin_bilstm_att.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. Global:
  2. use_gpu: True
  3. epoch_num: 6
  4. log_smooth_window: 50
  5. print_batch_step: 50
  6. save_model_dir: ./output/rec/rec_r32_gaspin_bilstm_att/
  7. save_epoch_step: 3
  8. # evaluation is run every 2000 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/dict/spin_dict.txt
  18. max_text_length: 25
  19. infer_mode: False
  20. use_space_char: False
  21. save_res_path: ./output/rec/predicts_r32_gaspin_bilstm_att.txt
  22. Optimizer:
  23. name: AdamW
  24. beta1: 0.9
  25. beta2: 0.999
  26. lr:
  27. name: Piecewise
  28. decay_epochs: [3, 4, 5]
  29. values: [0.001, 0.0003, 0.00009, 0.000027]
  30. clip_norm: 5
  31. Architecture:
  32. model_type: rec
  33. algorithm: SPIN
  34. in_channels: 1
  35. Transform:
  36. name: GA_SPIN
  37. offsets: True
  38. default_type: 6
  39. loc_lr: 0.1
  40. stn: True
  41. Backbone:
  42. name: ResNet32
  43. out_channels: 512
  44. Neck:
  45. name: SequenceEncoder
  46. encoder_type: cascadernn
  47. hidden_size: 256
  48. out_channels: [256, 512]
  49. with_linear: True
  50. Head:
  51. name: SPINAttentionHead
  52. hidden_size: 256
  53. Loss:
  54. name: SPINAttentionLoss
  55. ignore_index: 0
  56. PostProcess:
  57. name: SPINLabelDecode
  58. use_space_char: False
  59. Metric:
  60. name: RecMetric
  61. main_indicator: acc
  62. is_filter: True
  63. Train:
  64. dataset:
  65. name: SimpleDataSet
  66. data_dir: ./train_data/ic15_data/
  67. label_file_list: ["./train_data/ic15_data/rec_gt_train.txt"]
  68. transforms:
  69. - DecodeImage: # load image
  70. img_mode: BGR
  71. channel_first: False
  72. - SPINLabelEncode: # Class handling label
  73. - SPINRecResizeImg:
  74. image_shape: [100, 32]
  75. interpolation : 2
  76. mean: [127.5]
  77. std: [127.5]
  78. - KeepKeys:
  79. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  80. loader:
  81. shuffle: True
  82. batch_size_per_card: 8
  83. drop_last: True
  84. num_workers: 4
  85. Eval:
  86. dataset:
  87. name: SimpleDataSet
  88. data_dir: ./train_data/ic15_data
  89. label_file_list: ["./train_data/ic15_data/rec_gt_test.txt"]
  90. transforms:
  91. - DecodeImage: # load image
  92. img_mode: BGR
  93. channel_first: False
  94. - SPINLabelEncode: # Class handling label
  95. - SPINRecResizeImg:
  96. image_shape: [100, 32]
  97. interpolation : 2
  98. mean: [127.5]
  99. std: [127.5]
  100. - KeepKeys:
  101. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  102. loader:
  103. shuffle: False
  104. drop_last: False
  105. batch_size_per_card: 8
  106. num_workers: 2