rec_r45_visionlan.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. Global:
  2. use_gpu: true
  3. epoch_num: 8
  4. log_smooth_window: 200
  5. print_batch_step: 200
  6. save_model_dir: ./output/rec/r45_visionlan
  7. save_epoch_step: 1
  8. # evaluation is run every 2000 iterations
  9. eval_batch_step: [0, 2000]
  10. cal_metric_during_train: True
  11. pretrained_model:
  12. checkpoints:
  13. save_inference_dir:
  14. use_visualdl: True
  15. infer_img: doc/imgs_words/en/word_2.png
  16. # for data or label process
  17. character_dict_path:
  18. max_text_length: &max_text_length 25
  19. training_step: &training_step LA
  20. infer_mode: False
  21. use_space_char: False
  22. save_res_path: ./output/rec/predicts_visionlan.txt
  23. Optimizer:
  24. name: Adam
  25. beta1: 0.9
  26. beta2: 0.999
  27. clip_norm: 20.0
  28. group_lr: true
  29. training_step: *training_step
  30. lr:
  31. name: Piecewise
  32. decay_epochs: [6]
  33. values: [0.0001, 0.00001]
  34. regularizer:
  35. name: 'L2'
  36. factor: 0
  37. Architecture:
  38. model_type: rec
  39. algorithm: VisionLAN
  40. Transform:
  41. Backbone:
  42. name: ResNet45
  43. strides: [2, 2, 2, 1, 1]
  44. Head:
  45. name: VLHead
  46. n_layers: 3
  47. n_position: 256
  48. n_dim: 512
  49. max_text_length: *max_text_length
  50. training_step: *training_step
  51. Loss:
  52. name: VLLoss
  53. mode: *training_step
  54. weight_res: 0.5
  55. weight_mas: 0.5
  56. PostProcess:
  57. name: VLLabelDecode
  58. Metric:
  59. name: RecMetric
  60. is_filter: true
  61. Train:
  62. dataset:
  63. name: LMDBDataSet
  64. data_dir: ./train_data/data_lmdb_release/training/
  65. transforms:
  66. - DecodeImage: # load image
  67. img_mode: RGB
  68. channel_first: False
  69. - ABINetRecAug:
  70. - VLLabelEncode: # Class handling label
  71. - VLRecResizeImg:
  72. image_shape: [3, 64, 256]
  73. - KeepKeys:
  74. keep_keys: ['image', 'label', 'label_res', 'label_sub', 'label_id', 'length'] # dataloader will return list in this order
  75. loader:
  76. shuffle: True
  77. batch_size_per_card: 220
  78. drop_last: True
  79. num_workers: 4
  80. Eval:
  81. dataset:
  82. name: LMDBDataSet
  83. data_dir: ./train_data/data_lmdb_release/validation/
  84. transforms:
  85. - DecodeImage: # load image
  86. img_mode: RGB
  87. channel_first: False
  88. - VLLabelEncode: # Class handling label
  89. - VLRecResizeImg:
  90. image_shape: [3, 64, 256]
  91. - KeepKeys:
  92. keep_keys: ['image', 'label', 'label_res', 'label_sub', 'label_id', 'length'] # dataloader will return list in this order
  93. loader:
  94. shuffle: False
  95. drop_last: False
  96. batch_size_per_card: 64
  97. num_workers: 4