rec_r45_abinet.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Global:
  2. use_gpu: True
  3. epoch_num: 10
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/rec/r45_abinet/
  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: ./pretrain_models/abinet_vl_pretrained
  12. checkpoints:
  13. save_inference_dir:
  14. use_visualdl: False
  15. infer_img: doc/imgs_words_en/word_10.png
  16. # for data or label process
  17. character_dict_path:
  18. character_type: en
  19. max_text_length: 25
  20. infer_mode: False
  21. use_space_char: False
  22. save_res_path: ./output/rec/predicts_abinet.txt
  23. Optimizer:
  24. name: Adam
  25. beta1: 0.9
  26. beta2: 0.99
  27. clip_norm: 20.0
  28. lr:
  29. name: Piecewise
  30. decay_epochs: [6]
  31. values: [0.0001, 0.00001]
  32. regularizer:
  33. name: 'L2'
  34. factor: 0.
  35. Architecture:
  36. model_type: rec
  37. algorithm: ABINet
  38. in_channels: 3
  39. Transform:
  40. Backbone:
  41. name: ResNet45
  42. Head:
  43. name: ABINetHead
  44. use_lang: True
  45. iter_size: 3
  46. Loss:
  47. name: CELoss
  48. ignore_index: &ignore_index 100 # Must be greater than the number of character classes
  49. PostProcess:
  50. name: ABINetLabelDecode
  51. Metric:
  52. name: RecMetric
  53. main_indicator: acc
  54. Train:
  55. dataset:
  56. name: LMDBDataSet
  57. data_dir: ./train_data/data_lmdb_release/training/
  58. transforms:
  59. - DecodeImage: # load image
  60. img_mode: RGB
  61. channel_first: False
  62. - ABINetRecAug:
  63. - ABINetLabelEncode: # Class handling label
  64. ignore_index: *ignore_index
  65. - ABINetRecResizeImg:
  66. image_shape: [3, 32, 128]
  67. - KeepKeys:
  68. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  69. loader:
  70. shuffle: True
  71. batch_size_per_card: 96
  72. drop_last: True
  73. num_workers: 4
  74. Eval:
  75. dataset:
  76. name: LMDBDataSet
  77. data_dir: ./train_data/data_lmdb_release/evaluation/
  78. transforms:
  79. - DecodeImage: # load image
  80. img_mode: RGB
  81. channel_first: False
  82. - ABINetLabelEncode: # Class handling label
  83. ignore_index: *ignore_index
  84. - ABINetRecResizeImg:
  85. image_shape: [3, 32, 128]
  86. - KeepKeys:
  87. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  88. loader:
  89. shuffle: False
  90. drop_last: False
  91. batch_size_per_card: 256
  92. num_workers: 4
  93. use_shared_memory: False