crnn_ctc_long.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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_long/
  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: RatioDataSetTVResize
  73. ds_width: True
  74. padding: False
  75. base_shape: [[32, 32], [64, 32], [96, 32], [128, 32]]
  76. data_dir_list: [
  77. '../evaluation/CUTE80',
  78. '../evaluation/IC13_857',
  79. '../evaluation/IC15_1811',
  80. '../evaluation/IIIT5k',
  81. '../evaluation/SVT',
  82. '../evaluation/SVTP',
  83. ]
  84. transforms:
  85. - DecodeImagePIL: # load image
  86. img_mode: RGB
  87. - CTCLabelEncode: # Class handling label
  88. character_dict_path: *character_dict_path
  89. use_space_char: *use_space_char
  90. max_text_length: *max_text_length
  91. - KeepKeys:
  92. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  93. sampler:
  94. name: RatioSampler
  95. scales: [[128, 32]] # w, h
  96. # divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
  97. first_bs: 256
  98. fix_bs: false
  99. divided_factor: [4, 16] # w, h
  100. is_training: False
  101. loader:
  102. shuffle: False
  103. drop_last: False
  104. batch_size_per_card: 256
  105. max_ratio: 20
  106. num_workers: 4