convnextv2_tiny_h8_ctc.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. Global:
  2. device: gpu
  3. epoch_num: 20
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. output_dir: ./output/rec/u14m_filter/convnextv2_tiny_h8_ctc/
  7. eval_epoch_step: [0, 1]
  8. eval_batch_step: [0, 500]
  9. cal_metric_during_train: True
  10. pretrained_model:
  11. checkpoints:
  12. use_tensorboard: false
  13. infer_img:
  14. # for data or label process
  15. character_dict_path: &character_dict_path ./tools/utils/EN_symbol_dict.txt
  16. max_text_length: &max_text_length 25
  17. use_space_char: &use_space_char False
  18. save_res_path: ./output/rec/u14m_filter/predicts_convnextv2_h8_ctc.txt
  19. use_amp: True
  20. Optimizer:
  21. name: AdamW
  22. lr: 0.00065 # for 4gpus bs256/gpu
  23. weight_decay: 0.05
  24. filter_bias_and_bn: True
  25. LRScheduler:
  26. name: OneCycleLR
  27. warmup_epoch: 1.5 # pct_start 0.075*20 = 1.5ep
  28. cycle_momentum: False
  29. Architecture:
  30. model_type: rec
  31. algorithm: SVTR
  32. Transform:
  33. Encoder:
  34. name: ConvNeXtV2
  35. out_channels: 256
  36. depths: [3, 3, 9, 3]
  37. dims: [96, 192, 384, 768]
  38. drop_path_rate: 0.1
  39. strides: [[4,4], [1,1], [2,1], [1,1]]
  40. last_stage: True
  41. Decoder:
  42. name: CTCDecoder
  43. Loss:
  44. name: CTCLoss
  45. zero_infinity: True
  46. PostProcess:
  47. name: CTCLabelDecode
  48. character_dict_path: *character_dict_path
  49. use_space_char: *use_space_char
  50. Metric:
  51. name: RecMetric
  52. main_indicator: acc
  53. is_filter: True
  54. Train:
  55. dataset:
  56. name: LMDBDataSet
  57. data_dir: ../Union14M-L-LMDB-Filtered
  58. transforms:
  59. - DecodeImagePIL: # load image
  60. img_mode: RGB
  61. - PARSeqAugPIL:
  62. - CTCLabelEncode: # Class handling label
  63. character_dict_path: *character_dict_path
  64. use_space_char: *use_space_char
  65. max_text_length: *max_text_length
  66. - RecTVResize:
  67. image_shape: [32, 128]
  68. padding: False
  69. - KeepKeys:
  70. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  71. loader:
  72. shuffle: True
  73. batch_size_per_card: 256
  74. drop_last: True
  75. num_workers: 4
  76. Eval:
  77. dataset:
  78. name: LMDBDataSet
  79. data_dir: ../evaluation/
  80. transforms:
  81. - DecodeImagePIL: # load image
  82. img_mode: RGB
  83. - CTCLabelEncode: # Class handling label
  84. character_dict_path: *character_dict_path
  85. use_space_char: *use_space_char
  86. max_text_length: *max_text_length
  87. - RecTVResize:
  88. image_shape: [32, 128]
  89. padding: False
  90. - KeepKeys:
  91. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  92. loader:
  93. shuffle: False
  94. drop_last: False
  95. batch_size_per_card: 256
  96. num_workers: 2