svtrv2_aster_tps_on.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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_tps_on
  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_tps_on.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. name: Aster_TPS
  34. tps_inputsize: [32, 64]
  35. tps_outputsize: [32, 128]
  36. Encoder:
  37. name: SVTRv2LNConvTwo33
  38. use_pos_embed: False
  39. out_channels: 256
  40. dims: [128, 256, 384]
  41. depths: [6, 6, 6]
  42. num_heads: [4, 8, 12]
  43. mixer: [['Conv','Conv','Conv','Conv','Conv','Conv'],['Conv','Conv','FGlobal','Global','Global','Global'],['Global','Global','Global','Global','Global','Global']]
  44. local_k: [[5, 5], [5, 5], [-1, -1]]
  45. sub_k: [[1, 1], [2, 1], [-1, -1]]
  46. last_stage: false
  47. feat2d: False
  48. Decoder:
  49. name: ASTERDecoder
  50. Loss:
  51. name: ARLoss
  52. Metric:
  53. name: RecMetric
  54. main_indicator: acc
  55. is_filter: True
  56. PostProcess:
  57. name: ARLabelDecode
  58. Train:
  59. dataset:
  60. name: LMDBDataSet
  61. data_dir: ../Union14M-L-LMDB-Filtered
  62. transforms:
  63. - DecodeImagePIL: # load image
  64. img_mode: RGB
  65. - PARSeqAugPIL:
  66. - ARLabelEncode: # Class handling label
  67. - RecTVResize:
  68. image_shape: [64, 256]
  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. - ARLabelEncode: # Class handling label
  85. - RecTVResize:
  86. image_shape: [64, 256]
  87. padding: False
  88. - KeepKeys:
  89. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  90. loader:
  91. shuffle: False
  92. drop_last: False
  93. batch_size_per_card: 256
  94. num_workers: 2