rec_r31_robustscanner.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. Global:
  2. use_gpu: true
  3. epoch_num: 5
  4. log_smooth_window: 20
  5. print_batch_step: 20
  6. save_model_dir: ./output/rec/rec_r31_robustscanner/
  7. save_epoch_step: 1
  8. # evaluation is run every 2000 iterations
  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/dict90.txt
  18. max_text_length: &max_text_length 40
  19. infer_mode: False
  20. use_space_char: False
  21. rm_symbol: True
  22. save_res_path: ./output/rec/predicts_robustscanner.txt
  23. Optimizer:
  24. name: Adam
  25. beta1: 0.9
  26. beta2: 0.999
  27. lr:
  28. name: Piecewise
  29. decay_epochs: [3, 4]
  30. values: [0.001, 0.0001, 0.00001]
  31. regularizer:
  32. name: 'L2'
  33. factor: 0
  34. Architecture:
  35. model_type: rec
  36. algorithm: RobustScanner
  37. Transform:
  38. Backbone:
  39. name: ResNet31
  40. init_type: KaimingNormal
  41. Head:
  42. name: RobustScannerHead
  43. enc_outchannles: 128
  44. hybrid_dec_rnn_layers: 2
  45. hybrid_dec_dropout: 0
  46. position_dec_rnn_layers: 2
  47. start_idx: 91
  48. mask: True
  49. padding_idx: 92
  50. encode_value: False
  51. max_text_length: *max_text_length
  52. Loss:
  53. name: SARLoss
  54. PostProcess:
  55. name: SARLabelDecode
  56. Metric:
  57. name: RecMetric
  58. is_filter: True
  59. Train:
  60. dataset:
  61. name: LMDBDataSet
  62. data_dir: ./train_data/data_lmdb_release/training/
  63. transforms:
  64. - DecodeImage: # load image
  65. img_mode: BGR
  66. channel_first: False
  67. - SARLabelEncode: # Class handling label
  68. - RobustScannerRecResizeImg:
  69. image_shape: [3, 48, 48, 160] # h:48 w:[48,160]
  70. width_downsample_ratio: 0.25
  71. max_text_length: *max_text_length
  72. - KeepKeys:
  73. keep_keys: ['image', 'label', 'valid_ratio', 'word_positons'] # dataloader will return list in this order
  74. loader:
  75. shuffle: True
  76. batch_size_per_card: 64
  77. drop_last: True
  78. num_workers: 8
  79. use_shared_memory: False
  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. - SARLabelEncode: # Class handling label
  89. - RobustScannerRecResizeImg:
  90. image_shape: [3, 48, 48, 160]
  91. max_text_length: *max_text_length
  92. width_downsample_ratio: 0.25
  93. - KeepKeys:
  94. keep_keys: ['image', 'label', 'valid_ratio', 'word_positons'] # dataloader will return list in this order
  95. loader:
  96. shuffle: False
  97. drop_last: False
  98. batch_size_per_card: 64
  99. num_workers: 4
  100. use_shared_memory: False