resnet45_trans_visionlan_LA.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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/resnet45_trans_visionlan_LA/
  7. eval_epoch_step: [0, 1]
  8. eval_batch_step: [0, 500]
  9. cal_metric_during_train: True
  10. pretrained_model:
  11. # ./output/rec/u14m_filter/resnet45_trans_visionlan_LF2/best.pth
  12. checkpoints:
  13. use_tensorboard: false
  14. infer_img:
  15. # for data or label process
  16. character_dict_path: &character_dict_path ./tools/utils/EN_symbol_dict.txt # 96en
  17. # ./tools/utils/ppocr_keys_v1.txt # ch
  18. max_text_length: &max_text_length 25
  19. use_space_char: &use_space_char False
  20. save_res_path: ./output/rec/u14m_filter/predicts_resnet45_trans_visionlan_LA.txt
  21. grad_clip_val: 20
  22. use_amp: True
  23. Optimizer:
  24. name: Adam
  25. lr: 0.0002 # for 4gpus bs128/gpu
  26. weight_decay: 0.0
  27. LRScheduler:
  28. name: MultiStepLR
  29. milestones: [12]
  30. Architecture:
  31. model_type: rec
  32. algorithm: VisionLAN
  33. Transform:
  34. Encoder:
  35. name: ResNet45
  36. in_channels: 3
  37. strides: [2, 2, 2, 1, 1]
  38. Decoder:
  39. name: VisionLANDecoder
  40. training_step: &training_step 'LA'
  41. n_position: 256
  42. Loss:
  43. name: VisionLANLoss
  44. training_step: *training_step
  45. PostProcess:
  46. name: VisionLANLabelDecode
  47. character_dict_path: *character_dict_path
  48. use_space_char: *use_space_char
  49. Metric:
  50. name: RecMetric
  51. main_indicator: acc
  52. is_filter: True
  53. Train:
  54. dataset:
  55. name: LMDBDataSet
  56. data_dir: ../Union14M-L-LMDB-Filtered
  57. transforms:
  58. - DecodeImagePIL: # load image
  59. img_mode: RGB
  60. - PARSeqAugPIL:
  61. - VisionLANLabelEncode:
  62. character_dict_path: *character_dict_path
  63. use_space_char: *use_space_char
  64. max_text_length: *max_text_length
  65. - RecTVResize:
  66. image_shape: [64, 256]
  67. padding: False
  68. - KeepKeys:
  69. keep_keys: ['image', 'label', 'label_res', 'label_sub', 'label_id', 'length'] # dataloader will return list in this order
  70. loader:
  71. shuffle: True
  72. batch_size_per_card: 128
  73. drop_last: True
  74. num_workers: 4
  75. Eval:
  76. dataset:
  77. name: LMDBDataSet
  78. data_dir: ../evaluation
  79. transforms:
  80. - DecodeImagePIL: # load image
  81. img_mode: RGB
  82. - VisionLANLabelEncode:
  83. character_dict_path: *character_dict_path
  84. use_space_char: *use_space_char
  85. max_text_length: *max_text_length
  86. - RecTVResize:
  87. image_shape: [64, 256]
  88. padding: False
  89. - KeepKeys:
  90. keep_keys: ['image', 'label', 'label_res', 'label_sub', 'label_id', 'length'] # dataloader will return list in this order
  91. loader:
  92. shuffle: False
  93. drop_last: False
  94. batch_size_per_card: 128
  95. num_workers: 2