rec_svtrnet_ch.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. Global:
  2. use_gpu: true
  3. epoch_num: 100
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/rec/svtr_ch_all/
  7. save_epoch_step: 10
  8. eval_batch_step:
  9. - 0
  10. - 2000
  11. cal_metric_during_train: true
  12. pretrained_model: null
  13. checkpoints: null
  14. save_inference_dir: null
  15. use_visualdl: false
  16. infer_img: doc/imgs_words/ch/word_1.jpg
  17. character_dict_path: ppocr/utils/ppocr_keys_v1.txt
  18. max_text_length: 25
  19. infer_mode: false
  20. use_space_char: true
  21. save_res_path: ./output/rec/predicts_svtr_tiny_ch_all.txt
  22. Optimizer:
  23. name: AdamW
  24. beta1: 0.9
  25. beta2: 0.99
  26. epsilon: 1.0e-08
  27. weight_decay: 0.05
  28. no_weight_decay_name: norm pos_embed
  29. one_dim_param_no_weight_decay: true
  30. lr:
  31. name: Cosine
  32. learning_rate: 0.0005
  33. warmup_epoch: 2
  34. Architecture:
  35. model_type: rec
  36. algorithm: SVTR
  37. Transform: null
  38. Backbone:
  39. name: SVTRNet
  40. img_size:
  41. - 32
  42. - 320
  43. out_char_num: 40 # W//4 or W//8 or W/12
  44. out_channels: 96
  45. patch_merging: Conv
  46. embed_dim:
  47. - 64
  48. - 128
  49. - 256
  50. depth:
  51. - 3
  52. - 6
  53. - 3
  54. num_heads:
  55. - 2
  56. - 4
  57. - 8
  58. mixer:
  59. - Local
  60. - Local
  61. - Local
  62. - Local
  63. - Local
  64. - Local
  65. - Global
  66. - Global
  67. - Global
  68. - Global
  69. - Global
  70. - Global
  71. local_mixer:
  72. - - 7
  73. - 11
  74. - - 7
  75. - 11
  76. - - 7
  77. - 11
  78. last_stage: true
  79. prenorm: false
  80. Neck:
  81. name: SequenceEncoder
  82. encoder_type: reshape
  83. Head:
  84. name: CTCHead
  85. Loss:
  86. name: CTCLoss
  87. PostProcess:
  88. name: CTCLabelDecode
  89. Metric:
  90. name: RecMetric
  91. main_indicator: acc
  92. Train:
  93. dataset:
  94. name: SimpleDataSet
  95. data_dir: ./train_data
  96. label_file_list:
  97. - ./train_data/train_list.txt
  98. ext_op_transform_idx: 1
  99. transforms:
  100. - DecodeImage:
  101. img_mode: BGR
  102. channel_first: false
  103. - RecConAug:
  104. prob: 0.5
  105. ext_data_num: 2
  106. image_shape:
  107. - 32
  108. - 320
  109. - 3
  110. - RecAug: null
  111. - CTCLabelEncode: null
  112. - SVTRRecResizeImg:
  113. image_shape:
  114. - 3
  115. - 32
  116. - 320
  117. padding: true
  118. - KeepKeys:
  119. keep_keys:
  120. - image
  121. - label
  122. - length
  123. loader:
  124. shuffle: true
  125. batch_size_per_card: 256
  126. drop_last: true
  127. num_workers: 8
  128. Eval:
  129. dataset:
  130. name: SimpleDataSet
  131. data_dir: ./train_data
  132. label_file_list:
  133. - ./train_data/val_list.txt
  134. transforms:
  135. - DecodeImage:
  136. img_mode: BGR
  137. channel_first: false
  138. - CTCLabelEncode: null
  139. - SVTRRecResizeImg:
  140. image_shape:
  141. - 3
  142. - 32
  143. - 320
  144. padding: true
  145. - KeepKeys:
  146. keep_keys:
  147. - image
  148. - label
  149. - length
  150. loader:
  151. shuffle: false
  152. drop_last: false
  153. batch_size_per_card: 256
  154. num_workers: 2
  155. profiler_options: null