resnet45_trans_visionlan_LF_1.yml 2.5 KB

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