svtrv2_aster.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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_aster
  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: ./tools/utils/EN_symbol_dict.txt
  16. max_text_length: 25
  17. use_space_char: False
  18. save_res_path: ./output/rec/u14m_filter/predicts_svtrv2_aster.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: aster
  32. Transform:
  33. Encoder:
  34. name: SVTRv2LNConvTwo33
  35. use_pos_embed: False
  36. out_channels: 256
  37. dims: [128, 256, 384]
  38. depths: [6, 6, 6]
  39. num_heads: [4, 8, 12]
  40. mixer: [['Conv','Conv','Conv','Conv','Conv','Conv'],['Conv','Conv','FGlobal','Global','Global','Global'],['Global','Global','Global','Global','Global','Global']]
  41. local_k: [[5, 5], [5, 5], [-1, -1]]
  42. sub_k: [[1, 1], [2, 1], [-1, -1]]
  43. last_stage: false
  44. feat2d: False
  45. Decoder:
  46. name: ASTERDecoder
  47. Loss:
  48. name: ARLoss
  49. Metric:
  50. name: RecMetric
  51. main_indicator: acc
  52. is_filter: True
  53. PostProcess:
  54. name: ARLabelDecode
  55. Train:
  56. dataset:
  57. name: RatioDataSetTVResize
  58. ds_width: True
  59. padding: false
  60. data_dir_list: ['../Union14M-L-LMDB-Filtered/filter_train_challenging',
  61. '../Union14M-L-LMDB-Filtered/filter_train_hard',
  62. '../Union14M-L-LMDB-Filtered/filter_train_medium',
  63. '../Union14M-L-LMDB-Filtered/filter_train_normal',
  64. '../Union14M-L-LMDB-Filtered/filter_train_easy',
  65. ]
  66. transforms:
  67. - DecodeImagePIL: # load image
  68. img_mode: RGB
  69. - PARSeqAugPIL:
  70. - ARLabelEncode: # Class handling label
  71. - KeepKeys:
  72. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  73. sampler:
  74. name: RatioSampler
  75. scales: [[128, 32]] # w, h
  76. # divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
  77. first_bs: &bs 256
  78. fix_bs: false
  79. divided_factor: [4, 16] # w, h
  80. is_training: True
  81. loader:
  82. shuffle: True
  83. batch_size_per_card: *bs
  84. drop_last: True
  85. max_ratio: &max_ratio 4
  86. num_workers: 4
  87. Eval:
  88. dataset:
  89. name: RatioDataSetTVResize
  90. ds_width: True
  91. padding: False
  92. data_dir_list: [
  93. '../evaluation/CUTE80',
  94. '../evaluation/IC13_857',
  95. '../evaluation/IC15_1811',
  96. '../evaluation/IIIT5k',
  97. '../evaluation/SVT',
  98. '../evaluation/SVTP',
  99. ]
  100. transforms:
  101. - DecodeImagePIL: # load image
  102. img_mode: RGB
  103. - ARLabelEncode: # Class handling label
  104. - KeepKeys:
  105. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  106. sampler:
  107. name: RatioSampler
  108. scales: [[128, 32]] # w, h
  109. # divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
  110. first_bs: *bs
  111. fix_bs: false
  112. divided_factor: [4, 16] # w, h
  113. is_training: False
  114. loader:
  115. shuffle: False
  116. drop_last: False
  117. batch_size_per_card: *bs
  118. max_ratio: *max_ratio
  119. num_workers: 4