autostr_lstm_aster_tps_on.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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/autostr_lstm_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_autostr_lstm_aster_tps_on.txt
  19. use_amp: True
  20. grad_clip_val: 1.0
  21. Optimizer:
  22. name: Adam
  23. lr: 0.002 # for 4gpus bs256/gpu
  24. weight_decay: 0.0
  25. filter_bias_and_bn: False
  26. LRScheduler:
  27. name: OneCycleLR
  28. warmup_epoch: 1.5 # pct_start 0.075*20 = 1.5ep
  29. cycle_momentum: False
  30. Architecture:
  31. model_type: rec
  32. algorithm: autostr
  33. Transform:
  34. name: Aster_TPS
  35. tps_inputsize: [32, 64]
  36. tps_outputsize: [32, 128]
  37. Encoder:
  38. name: AutoSTREncoder
  39. stride_stages: '[(2, 2), (2, 1), (2, 2), (2, 1), (2, 1)]'
  40. conv_op_ids: [2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 4, 1, 1, 6, 6]
  41. Decoder:
  42. name: ASTERDecoder
  43. Loss:
  44. name: ARLoss
  45. Metric:
  46. name: RecMetric
  47. main_indicator: acc
  48. is_filter: True
  49. PostProcess:
  50. name: ARLabelDecode
  51. Train:
  52. dataset:
  53. name: LMDBDataSet
  54. data_dir: ../Union14M-L-LMDB-Filtered
  55. transforms:
  56. - DecodeImagePIL: # load image
  57. img_mode: RGB
  58. - PARSeqAugPIL:
  59. - ARLabelEncode: # Class handling label
  60. - RecTVResize:
  61. image_shape: [64, 256]
  62. padding: False
  63. - KeepKeys:
  64. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  65. loader:
  66. shuffle: True
  67. batch_size_per_card: 256
  68. drop_last: True
  69. num_workers: 4
  70. Eval:
  71. dataset:
  72. name: LMDBDataSet
  73. data_dir: ../evaluation
  74. transforms:
  75. - DecodeImagePIL: # load image
  76. img_mode: RGB
  77. - ARLabelEncode: # Class handling label
  78. - RecTVResize:
  79. image_shape: [64, 256]
  80. padding: False
  81. - KeepKeys:
  82. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  83. loader:
  84. shuffle: False
  85. drop_last: False
  86. batch_size_per_card: 256
  87. num_workers: 2