resnet31_lstm_moran.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/resnet31_lstm_moran
  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/predicts_moran.txt
  19. use_amp: True
  20. grad_clip_val: 1.0
  21. Optimizer:
  22. name: Adam
  23. lr: 0.002 # for 1gpus bs1024/gpu
  24. weight_decay: 0.05
  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: MORAN
  33. Transform:
  34. name: MORN
  35. target_shape: [32, 128]
  36. Encoder:
  37. name: ResNet_ASTER
  38. Decoder:
  39. name: ASTERDecoder
  40. Loss:
  41. name: ARLoss
  42. Metric:
  43. name: RecMetric
  44. main_indicator: acc
  45. is_filter: True
  46. PostProcess:
  47. name: ARLabelDecode
  48. Train:
  49. dataset:
  50. name: LMDBDataSet
  51. data_dir: ../Union14M-L-LMDB-Filtered
  52. transforms:
  53. - DecodeImagePIL: # load image
  54. img_mode: RGB
  55. - PARSeqAugPIL:
  56. - ARLabelEncode: # Class handling label
  57. - RecTVResize:
  58. image_shape: [64, 256]
  59. padding: False
  60. - KeepKeys:
  61. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  62. loader:
  63. shuffle: True
  64. batch_size_per_card: 1024
  65. drop_last: True
  66. num_workers: 4
  67. Eval:
  68. dataset:
  69. name: LMDBDataSet
  70. data_dir: ../evaluation
  71. transforms:
  72. - DecodeImagePIL: # load image
  73. img_mode: RGB
  74. - ARLabelEncode: # Class handling label
  75. - RecTVResize:
  76. image_shape: [64, 256]
  77. padding: False
  78. - KeepKeys:
  79. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  80. loader:
  81. shuffle: False
  82. drop_last: False
  83. batch_size_per_card: 256
  84. num_workers: 2