convnextv2_rctc.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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_rctc/
  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_rctc.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: [2, 2, 8, 2]
  37. dims: [80, 160, 320, 640]
  38. drop_path_rate: 0.1
  39. strides: [[4,4], [2,1], [2,1], [1,1]]
  40. last_stage: false
  41. feat2d: True
  42. Decoder:
  43. name: RCTCDecoder
  44. Loss:
  45. name: CTCLoss
  46. zero_infinity: True
  47. PostProcess:
  48. name: CTCLabelDecode
  49. character_dict_path: *character_dict_path
  50. use_space_char: *use_space_char
  51. Metric:
  52. name: RecMetric
  53. main_indicator: acc
  54. is_filter: True
  55. Train:
  56. dataset:
  57. name: LMDBDataSet
  58. data_dir: ../Union14M-L-LMDB-Filtered
  59. transforms:
  60. - DecodeImagePIL: # load image
  61. img_mode: RGB
  62. - PARSeqAugPIL:
  63. - CTCLabelEncode: # Class handling label
  64. character_dict_path: *character_dict_path
  65. use_space_char: *use_space_char
  66. max_text_length: *max_text_length
  67. - RecTVResize:
  68. image_shape: [32, 128]
  69. padding: False
  70. - KeepKeys:
  71. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  72. loader:
  73. shuffle: True
  74. batch_size_per_card: 256
  75. drop_last: True
  76. num_workers: 4
  77. Eval:
  78. dataset:
  79. name: LMDBDataSet
  80. data_dir: ../evaluation/
  81. transforms:
  82. - DecodeImagePIL: # load image
  83. img_mode: RGB
  84. - CTCLabelEncode: # Class handling label
  85. character_dict_path: *character_dict_path
  86. use_space_char: *use_space_char
  87. max_text_length: *max_text_length
  88. - RecTVResize:
  89. image_shape: [32, 128]
  90. padding: False
  91. - KeepKeys:
  92. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  93. loader:
  94. shuffle: False
  95. drop_last: False
  96. batch_size_per_card: 256
  97. num_workers: 2