rec_r31_robustscanner.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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: ./inference/rec_inference
  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: SimpleDataSet
  62. data_dir: ./train_data/ic15_data/
  63. label_file_list: ["./train_data/ic15_data/rec_gt_train.txt"]
  64. transforms:
  65. - DecodeImage: # load image
  66. img_mode: BGR
  67. channel_first: False
  68. - SARLabelEncode: # Class handling label
  69. - RobustScannerRecResizeImg:
  70. image_shape: [3, 48, 48, 160] # h:48 w:[48,160]
  71. width_downsample_ratio: 0.25
  72. max_text_length: *max_text_length
  73. - KeepKeys:
  74. keep_keys: ['image', 'label', 'valid_ratio', 'word_positons'] # dataloader will return list in this order
  75. loader:
  76. shuffle: True
  77. batch_size_per_card: 16
  78. drop_last: True
  79. num_workers: 0
  80. use_shared_memory: False
  81. Eval:
  82. dataset:
  83. name: SimpleDataSet
  84. data_dir: ./train_data/ic15_data
  85. label_file_list: ["./train_data/ic15_data/rec_gt_test.txt"]
  86. transforms:
  87. - DecodeImage: # load image
  88. img_mode: BGR
  89. channel_first: False
  90. - SARLabelEncode: # Class handling label
  91. - RobustScannerRecResizeImg:
  92. image_shape: [3, 48, 48, 160]
  93. max_text_length: *max_text_length
  94. width_downsample_ratio: 0.25
  95. - KeepKeys:
  96. keep_keys: ['image', 'label', 'valid_ratio', 'word_positons'] # dataloader will return list in this order
  97. loader:
  98. shuffle: False
  99. drop_last: False
  100. batch_size_per_card: 16
  101. num_workers: 0
  102. use_shared_memory: False