crnn_ctc.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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/crnn_ctc/
  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: &character_dict_path ./tools/utils/EN_symbol_dict.txt
  16. max_text_length: &max_text_length 25
  17. use_space_char: &use_space_char False
  18. save_res_path: ./output/rec/u14m_filter/predicts_crnn_ctc.txt
  19. use_amp: True
  20. Optimizer:
  21. name: AdamW
  22. lr: 0.00065 # for 4gpus bs256/gpu
  23. weight_decay: 0.0
  24. filter_bias_and_bn: False
  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: CRNN
  32. Transform:
  33. Encoder:
  34. name: ResNet_ASTER
  35. Decoder:
  36. name: CTCDecoder
  37. Loss:
  38. name: CTCLoss
  39. zero_infinity: True
  40. PostProcess:
  41. name: CTCLabelDecode
  42. character_dict_path: *character_dict_path
  43. use_space_char: *use_space_char
  44. Metric:
  45. name: RecMetric
  46. main_indicator: acc
  47. is_filter: True
  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. - CTCLabelEncode: # Class handling label
  57. character_dict_path: *character_dict_path
  58. use_space_char: *use_space_char
  59. max_text_length: *max_text_length
  60. - RecTVResize:
  61. image_shape: [32, 128]
  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. - CTCLabelEncode: # Class handling label
  78. character_dict_path: *character_dict_path
  79. use_space_char: *use_space_char
  80. max_text_length: *max_text_length
  81. - RecTVResize:
  82. image_shape: [32, 128]
  83. padding: False
  84. - KeepKeys:
  85. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  86. loader:
  87. shuffle: False
  88. drop_last: False
  89. batch_size_per_card: 256
  90. num_workers: 2