ch_PP-OCRv2_rec.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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
  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.txt
  22. Optimizer:
  23. name: Adam
  24. beta1: 0.9
  25. beta2: 0.999
  26. lr:
  27. name: Piecewise
  28. decay_epochs : [700]
  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. Loss:
  50. name: CTCLoss
  51. PostProcess:
  52. name: CTCLabelDecode
  53. Metric:
  54. name: RecMetric
  55. main_indicator: acc
  56. Train:
  57. dataset:
  58. name: SimpleDataSet
  59. data_dir: ./train_data/
  60. label_file_list:
  61. - ./train_data/train_list.txt
  62. transforms:
  63. - DecodeImage:
  64. img_mode: BGR
  65. channel_first: false
  66. - RecAug:
  67. - CTCLabelEncode:
  68. - RecResizeImg:
  69. image_shape: [3, 32, 320]
  70. - KeepKeys:
  71. keep_keys:
  72. - image
  73. - label
  74. - length
  75. loader:
  76. shuffle: true
  77. batch_size_per_card: 128
  78. drop_last: true
  79. num_workers: 8
  80. Eval:
  81. dataset:
  82. name: SimpleDataSet
  83. data_dir: ./train_data
  84. label_file_list:
  85. - ./train_data/val_list.txt
  86. transforms:
  87. - DecodeImage:
  88. img_mode: BGR
  89. channel_first: false
  90. - CTCLabelEncode:
  91. - RecResizeImg:
  92. image_shape: [3, 32, 320]
  93. - KeepKeys:
  94. keep_keys:
  95. - image
  96. - label
  97. - length
  98. loader:
  99. shuffle: false
  100. drop_last: false
  101. batch_size_per_card: 128
  102. num_workers: 8