rec_r50_fpn_srn.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. Global:
  2. use_gpu: True
  3. epoch_num: 72
  4. log_smooth_window: 20
  5. print_batch_step: 5
  6. save_model_dir: ./output/rec/srn_new
  7. save_epoch_step: 3
  8. # evaluation is run every 5000 iterations after the 4000th iteration
  9. eval_batch_step: [0, 5000]
  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: 25
  19. num_heads: 8
  20. infer_mode: False
  21. use_space_char: False
  22. save_res_path: ./output/rec/predicts_srn.txt
  23. Optimizer:
  24. name: Adam
  25. beta1: 0.9
  26. beta2: 0.999
  27. clip_norm: 10.0
  28. lr:
  29. learning_rate: 0.0001
  30. Architecture:
  31. model_type: rec
  32. algorithm: SRN
  33. in_channels: 1
  34. Transform:
  35. Backbone:
  36. name: ResNetFPN
  37. Head:
  38. name: SRNHead
  39. max_text_length: 25
  40. num_heads: 8
  41. num_encoder_TUs: 2
  42. num_decoder_TUs: 4
  43. hidden_dims: 512
  44. Loss:
  45. name: SRNLoss
  46. PostProcess:
  47. name: SRNLabelDecode
  48. Metric:
  49. name: RecMetric
  50. main_indicator: acc
  51. Train:
  52. dataset:
  53. name: LMDBDataSet
  54. data_dir: ./train_data/data_lmdb_release/training/
  55. transforms:
  56. - DecodeImage: # load image
  57. img_mode: BGR
  58. channel_first: False
  59. - SRNLabelEncode: # Class handling label
  60. - SRNRecResizeImg:
  61. image_shape: [1, 64, 256]
  62. - KeepKeys:
  63. keep_keys: ['image',
  64. 'label',
  65. 'length',
  66. 'encoder_word_pos',
  67. 'gsrm_word_pos',
  68. 'gsrm_slf_attn_bias1',
  69. 'gsrm_slf_attn_bias2'] # dataloader will return list in this order
  70. loader:
  71. shuffle: False
  72. batch_size_per_card: 64
  73. drop_last: False
  74. num_workers: 4
  75. Eval:
  76. dataset:
  77. name: LMDBDataSet
  78. data_dir: ./train_data/data_lmdb_release/validation/
  79. transforms:
  80. - DecodeImage: # load image
  81. img_mode: BGR
  82. channel_first: False
  83. - SRNLabelEncode: # Class handling label
  84. - SRNRecResizeImg:
  85. image_shape: [1, 64, 256]
  86. - KeepKeys:
  87. keep_keys: ['image',
  88. 'label',
  89. 'length',
  90. 'encoder_word_pos',
  91. 'gsrm_word_pos',
  92. 'gsrm_slf_attn_bias1',
  93. 'gsrm_slf_attn_bias2']
  94. loader:
  95. shuffle: False
  96. drop_last: False
  97. batch_size_per_card: 32
  98. num_workers: 4