te_PP-OCRv3_rec.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. Global:
  2. debug: false
  3. use_gpu: true
  4. epoch_num: 500
  5. log_smooth_window: 20
  6. print_batch_step: 10
  7. save_model_dir: ./output/v3_te_mobile
  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/dict/te_dict.txt
  17. max_text_length: &max_text_length 25
  18. infer_mode: false
  19. use_space_char: true
  20. distributed: true
  21. save_res_path: ./output/rec/predicts_ppocrv3_te.txt
  22. Optimizer:
  23. name: Adam
  24. beta1: 0.9
  25. beta2: 0.999
  26. lr:
  27. name: Cosine
  28. learning_rate: 0.001
  29. warmup_epoch: 5
  30. regularizer:
  31. name: L2
  32. factor: 3.0e-05
  33. Architecture:
  34. model_type: rec
  35. algorithm: SVTR
  36. Transform:
  37. Backbone:
  38. name: MobileNetV1Enhance
  39. scale: 0.5
  40. last_conv_stride: [1, 2]
  41. last_pool_type: avg
  42. Head:
  43. name: MultiHead
  44. head_list:
  45. - CTCHead:
  46. Neck:
  47. name: svtr
  48. dims: 64
  49. depth: 2
  50. hidden_dims: 120
  51. use_guide: True
  52. Head:
  53. fc_decay: 0.00001
  54. - SARHead:
  55. enc_dim: 512
  56. max_text_length: *max_text_length
  57. Loss:
  58. name: MultiLoss
  59. loss_config_list:
  60. - CTCLoss:
  61. - SARLoss:
  62. PostProcess:
  63. name: CTCLabelDecode
  64. Metric:
  65. name: RecMetric
  66. main_indicator: acc
  67. ignore_space: False
  68. Train:
  69. dataset:
  70. name: SimpleDataSet
  71. data_dir: ./train_data/
  72. ext_op_transform_idx: 1
  73. label_file_list:
  74. - ./train_data/train_list.txt
  75. transforms:
  76. - DecodeImage:
  77. img_mode: BGR
  78. channel_first: false
  79. - RecConAug:
  80. prob: 0.5
  81. ext_data_num: 2
  82. image_shape: [48, 320, 3]
  83. - RecAug:
  84. - MultiLabelEncode:
  85. - RecResizeImg:
  86. image_shape: [3, 48, 320]
  87. - KeepKeys:
  88. keep_keys:
  89. - image
  90. - label_ctc
  91. - label_sar
  92. - length
  93. - valid_ratio
  94. loader:
  95. shuffle: true
  96. batch_size_per_card: 128
  97. drop_last: true
  98. num_workers: 4
  99. Eval:
  100. dataset:
  101. name: SimpleDataSet
  102. data_dir: ./train_data
  103. label_file_list:
  104. - ./train_data/val_list.txt
  105. transforms:
  106. - DecodeImage:
  107. img_mode: BGR
  108. channel_first: false
  109. - MultiLabelEncode:
  110. - RecResizeImg:
  111. image_shape: [3, 48, 320]
  112. - KeepKeys:
  113. keep_keys:
  114. - image
  115. - label_ctc
  116. - label_sar
  117. - length
  118. - valid_ratio
  119. loader:
  120. shuffle: false
  121. drop_last: false
  122. batch_size_per_card: 128
  123. num_workers: 4