rec_r45_abinet.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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:
  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: SimpleDataSet
  57. data_dir: ./train_data/ic15_data/
  58. label_file_list: ["./train_data/ic15_data/rec_gt_train.txt"]
  59. transforms:
  60. - DecodeImage: # load image
  61. img_mode: RGB
  62. channel_first: False
  63. - ABINetRecAug:
  64. - ABINetLabelEncode: # Class handling label
  65. ignore_index: *ignore_index
  66. - ABINetRecResizeImg:
  67. image_shape: [3, 32, 128]
  68. padding: False
  69. - KeepKeys:
  70. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  71. loader:
  72. shuffle: True
  73. batch_size_per_card: 96
  74. drop_last: True
  75. num_workers: 4
  76. Eval:
  77. dataset:
  78. name: SimpleDataSet
  79. data_dir: ./train_data/ic15_data
  80. label_file_list: ["./train_data/ic15_data/rec_gt_test.txt"]
  81. transforms:
  82. - DecodeImage: # load image
  83. img_mode: RGB
  84. channel_first: False
  85. - ABINetLabelEncode: # Class handling label
  86. ignore_index: *ignore_index
  87. - ABINetRecResizeImg:
  88. image_shape: [3, 32, 128]
  89. padding: False
  90. - KeepKeys:
  91. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  92. loader:
  93. shuffle: False
  94. drop_last: False
  95. batch_size_per_card: 256
  96. num_workers: 4
  97. use_shared_memory: False