svtrv2_abinet_lang.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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/svtrv2_abinet_lang/
  7. eval_epoch_step: [0, 1]
  8. eval_batch_step: [0, 500]
  9. cal_metric_during_train: True
  10. pretrained_model:
  11. # ./openocr_svtrv2_nolang_abinet_lang.pth
  12. checkpoints:
  13. use_tensorboard: false
  14. infer_img:
  15. # for data or label process
  16. character_dict_path: ./tools/utils/EN_symbol_dict.txt
  17. max_text_length: 25
  18. use_space_char: False
  19. save_res_path: ./output/rec/u14m_filter/predicts_svtrv2_abinet_lang.txt
  20. use_amp: True
  21. grad_clip_val: 20
  22. Optimizer:
  23. name: AdamW
  24. lr: 0.00065 # for 4gpus bs256/gpu
  25. weight_decay: 0.05
  26. filter_bias_and_bn: True
  27. LRScheduler:
  28. name: OneCycleLR
  29. warmup_epoch: 1.5 # pct_start 0.075*20 = 1.5ep
  30. cycle_momentum: False
  31. Architecture:
  32. model_type: rec
  33. algorithm: ABINet
  34. Transform:
  35. Encoder:
  36. name: SVTRv2LNConvTwo33
  37. use_pos_embed: False
  38. dims: [128, 256, 384]
  39. depths: [6, 6, 6]
  40. num_heads: [4, 8, 12]
  41. mixer: [['Conv','Conv','Conv','Conv','Conv','Conv'],['Conv','Conv','FGlobal','Global','Global','Global'],['Global','Global','Global','Global','Global','Global']]
  42. local_k: [[5, 5], [5, 5], [-1, -1]]
  43. sub_k: [[1, 1], [2, 1], [-1, -1]]
  44. last_stage: false
  45. feat2d: True
  46. Decoder:
  47. name: ABINetDecoder
  48. iter_size: 3
  49. num_layers: 0
  50. Loss:
  51. name: ABINetLoss
  52. PostProcess:
  53. name: ABINetLabelDecode
  54. Metric:
  55. name: RecMetric
  56. main_indicator: acc
  57. is_filter: True
  58. Train:
  59. dataset:
  60. name: RatioDataSetTVResize
  61. ds_width: True
  62. padding: false
  63. data_dir_list: ['../Union14M-L-LMDB-Filtered/filter_train_challenging',
  64. '../Union14M-L-LMDB-Filtered/filter_train_hard',
  65. '../Union14M-L-LMDB-Filtered/filter_train_medium',
  66. '../Union14M-L-LMDB-Filtered/filter_train_normal',
  67. '../Union14M-L-LMDB-Filtered/filter_train_easy',
  68. ]
  69. transforms:
  70. - DecodeImagePIL: # load image
  71. img_mode: RGB
  72. - PARSeqAugPIL:
  73. - ABINetLabelEncode:
  74. - KeepKeys:
  75. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  76. sampler:
  77. name: RatioSampler
  78. scales: [[128, 32]] # w, h
  79. # divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
  80. first_bs: &bs 256
  81. fix_bs: false
  82. divided_factor: [4, 16] # w, h
  83. is_training: True
  84. loader:
  85. shuffle: True
  86. batch_size_per_card: *bs
  87. drop_last: True
  88. max_ratio: &max_ratio 4
  89. num_workers: 4
  90. Eval:
  91. dataset:
  92. name: RatioDataSetTVResize
  93. ds_width: True
  94. padding: False
  95. data_dir_list: [
  96. '../evaluation/CUTE80',
  97. '../evaluation/IC13_857',
  98. '../evaluation/IC15_1811',
  99. '../evaluation/IIIT5k',
  100. '../evaluation/SVT',
  101. '../evaluation/SVTP',
  102. ]
  103. transforms:
  104. - DecodeImagePIL: # load image
  105. img_mode: RGB
  106. - ABINetLabelEncode:
  107. - KeepKeys:
  108. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  109. sampler:
  110. name: RatioSampler
  111. scales: [[128, 32]] # w, h
  112. # divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
  113. first_bs: *bs
  114. fix_bs: false
  115. divided_factor: [4, 16] # w, h
  116. is_training: False
  117. loader:
  118. shuffle: False
  119. drop_last: False
  120. batch_size_per_card: *bs
  121. max_ratio: *max_ratio
  122. num_workers: 4