ch_PP-OCRv2_rec_enhanced_ctc_loss.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. Global:
  2. debug: false
  3. use_gpu: true
  4. epoch_num: 800
  5. log_smooth_window: 20
  6. print_batch_step: 10
  7. save_model_dir: ./output/rec_mobile_pp-OCRv2_enhanced_ctc_loss
  8. save_epoch_step: 3
  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/ch/word_1.jpg
  16. character_dict_path: ppocr/utils/ppocr_keys_v1.txt
  17. max_text_length: 25
  18. infer_mode: false
  19. use_space_char: true
  20. distributed: true
  21. save_res_path: ./output/rec/predicts_mobile_pp-OCRv2_enhanced_ctc_loss.txt
  22. Optimizer:
  23. name: Adam
  24. beta1: 0.9
  25. beta2: 0.999
  26. lr:
  27. name: Piecewise
  28. decay_epochs : [700, 800]
  29. values : [0.001, 0.0001]
  30. warmup_epoch: 5
  31. regularizer:
  32. name: L2
  33. factor: 2.0e-05
  34. Architecture:
  35. model_type: rec
  36. algorithm: CRNN
  37. Transform:
  38. Backbone:
  39. name: MobileNetV1Enhance
  40. scale: 0.5
  41. Neck:
  42. name: SequenceEncoder
  43. encoder_type: rnn
  44. hidden_size: 64
  45. Head:
  46. name: CTCHead
  47. mid_channels: 96
  48. fc_decay: 0.00002
  49. return_feats: true
  50. Loss:
  51. name: CombinedLoss
  52. loss_config_list:
  53. - CTCLoss:
  54. use_focal_loss: false
  55. weight: 1.0
  56. - CenterLoss:
  57. weight: 0.05
  58. num_classes: 6625
  59. feat_dim: 96
  60. center_file_path:
  61. # you can also try to add ace loss on your own dataset
  62. # - ACELoss:
  63. # weight: 0.1
  64. PostProcess:
  65. name: CTCLabelDecode
  66. Metric:
  67. name: RecMetric
  68. main_indicator: acc
  69. Train:
  70. dataset:
  71. name: SimpleDataSet
  72. data_dir: ./train_data/
  73. label_file_list:
  74. - ./train_data/train_list.txt
  75. transforms:
  76. - DecodeImage:
  77. img_mode: BGR
  78. channel_first: false
  79. - RecAug:
  80. - CTCLabelEncode:
  81. - RecResizeImg:
  82. image_shape: [3, 32, 320]
  83. - KeepKeys:
  84. keep_keys:
  85. - image
  86. - label
  87. - length
  88. - label_ace
  89. loader:
  90. shuffle: true
  91. batch_size_per_card: 128
  92. drop_last: true
  93. num_workers: 8
  94. Eval:
  95. dataset:
  96. name: SimpleDataSet
  97. data_dir: ./train_data
  98. label_file_list:
  99. - ./train_data/val_list.txt
  100. transforms:
  101. - DecodeImage:
  102. img_mode: BGR
  103. channel_first: false
  104. - CTCLabelEncode:
  105. - RecResizeImg:
  106. image_shape: [3, 32, 320]
  107. - KeepKeys:
  108. keep_keys:
  109. - image
  110. - label
  111. - length
  112. loader:
  113. shuffle: false
  114. drop_last: false
  115. batch_size_per_card: 128
  116. num_workers: 8