rec_efficientb3_fpn_pren.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. Global:
  2. use_gpu: True
  3. epoch_num: 8
  4. log_smooth_window: 20
  5. print_batch_step: 5
  6. save_model_dir: ./output/rec/pren_new
  7. save_epoch_step: 3
  8. # evaluation is run every 2000 iterations after the 4000th iteration
  9. eval_batch_step: [4000, 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/ch/word_1.jpg
  16. # for data or label process
  17. character_dict_path:
  18. max_text_length: &max_text_length 25
  19. infer_mode: False
  20. use_space_char: False
  21. save_res_path: ./output/rec/predicts_pren.txt
  22. Optimizer:
  23. name: Adadelta
  24. lr:
  25. name: Piecewise
  26. decay_epochs: [2, 5, 7]
  27. values: [0.5, 0.1, 0.01, 0.001]
  28. Architecture:
  29. model_type: rec
  30. algorithm: PREN
  31. in_channels: 3
  32. Backbone:
  33. name: EfficientNetb3_PREN
  34. Neck:
  35. name: PRENFPN
  36. n_r: 5
  37. d_model: 384
  38. max_len: *max_text_length
  39. dropout: 0.1
  40. Head:
  41. name: PRENHead
  42. Loss:
  43. name: PRENLoss
  44. PostProcess:
  45. name: PRENLabelDecode
  46. Metric:
  47. name: RecMetric
  48. main_indicator: acc
  49. Train:
  50. dataset:
  51. name: LMDBDataSet
  52. data_dir: ./train_data/data_lmdb_release/training/
  53. transforms:
  54. - DecodeImage:
  55. img_mode: BGR
  56. channel_first: False
  57. - PRENLabelEncode:
  58. - RecAug:
  59. - PRENResizeImg:
  60. image_shape: [64, 256] # h,w
  61. - KeepKeys:
  62. keep_keys: ['image', 'label']
  63. loader:
  64. shuffle: True
  65. batch_size_per_card: 128
  66. drop_last: True
  67. num_workers: 8
  68. Eval:
  69. dataset:
  70. name: LMDBDataSet
  71. data_dir: ./train_data/data_lmdb_release/validation/
  72. transforms:
  73. - DecodeImage:
  74. img_mode: BGR
  75. channel_first: False
  76. - PRENLabelEncode:
  77. - PRENResizeImg:
  78. image_shape: [64, 256] # h,w
  79. - KeepKeys:
  80. keep_keys: ['image', 'label']
  81. loader:
  82. shuffle: False
  83. drop_last: False
  84. batch_size_per_card: 64
  85. num_workers: 8