repsvtr_ch.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. Global:
  2. device: gpu
  3. epoch_num: 100
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. output_dir: ./output/rec/ch/repsvtr_ch/
  7. save_epoch_step: [150, 10]
  8. # evaluation is run every 2000 iterations
  9. eval_epoch_step: [0, 1]
  10. eval_batch_step: [0, 2000]
  11. cal_metric_during_train: True
  12. pretrained_model: ./openocr_repsvtr_ch.pth
  13. checkpoints:
  14. use_tensorboard: false
  15. infer_img:
  16. # for data or label process
  17. character_dict_path: &character_dict_path ./tools/utils/ppocr_keys_v1.txt
  18. max_text_length: &max_text_length 25
  19. use_space_char: &use_space_char True
  20. save_res_path: ./output/rec/u14m_filter/predicts_svtrv2_ctc.txt
  21. use_amp: True
  22. project_name: resvtr_ctc_nosgm_ds
  23. Optimizer:
  24. name: Adam
  25. lr: 0.0001
  26. weight_decay: 3.0e-05
  27. filter_bias_and_bn: False
  28. LRScheduler:
  29. name: CosineAnnealingLR
  30. warmup_epoch: 5
  31. Architecture:
  32. model_type: rec
  33. algorithm: SVTRv2_mobile
  34. Transform:
  35. Encoder:
  36. name: RepSVTREncoder
  37. Decoder:
  38. name: CTCDecoder
  39. svtr_encoder:
  40. dims: 256
  41. depth: 2
  42. hidden_dims: 256
  43. kernel_size: [1, 3]
  44. use_guide: True
  45. Loss:
  46. name: CTCLoss
  47. zero_infinity: True
  48. PostProcess:
  49. name: CTCLabelDecode
  50. character_dict_path: *character_dict_path
  51. Metric:
  52. name: RecMetric
  53. main_indicator: acc
  54. ignore_space: False
  55. # is_filter: True
  56. Train:
  57. dataset:
  58. name: SimpleDataSet
  59. data_dir: ../ic15_data/
  60. label_file_list:
  61. - ../ic15_data/rec_gt_train.txt
  62. transforms:
  63. - DecodeImagePIL: # load image
  64. img_mode: RGB
  65. - PARSeqAugPIL:
  66. - CTCLabelEncode: # Class handling label
  67. character_dict_path: *character_dict_path
  68. use_space_char: *use_space_char
  69. max_text_length: *max_text_length
  70. - RecTVResize:
  71. image_shape: [48, 320]
  72. padding: True
  73. - KeepKeys:
  74. keep_keys: ['image', 'label', 'length']
  75. loader:
  76. shuffle: True
  77. batch_size_per_card: 256
  78. drop_last: True
  79. num_workers: 4
  80. Eval:
  81. dataset:
  82. name: SimpleDataSet
  83. data_dir: ../ic15_data/
  84. label_file_list:
  85. - ../ic15_data/rec_gt_test.txt
  86. transforms:
  87. - DecodeImage: # load image
  88. img_mode: BGR
  89. - CTCLabelEncode: # Class handling label
  90. character_dict_path: *character_dict_path
  91. use_space_char: *use_space_char
  92. max_text_length: *max_text_length
  93. - RecDynamicResize:
  94. image_shape: [48, 320]
  95. padding: False
  96. # - SVTRResize:
  97. # image_shape: [3, 48, 320]
  98. # padding: True
  99. - KeepKeys:
  100. keep_keys: ['image', 'label', 'length']
  101. loader:
  102. shuffle: False
  103. drop_last: False
  104. batch_size_per_card: 1
  105. num_workers: 4