rec_r50_fpn_srn.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. # if pretrained_model is saved in static mode, load_static_weights must set to True
  11. cal_metric_during_train: True
  12. pretrained_model:
  13. checkpoints:
  14. save_inference_dir:
  15. use_visualdl: False
  16. infer_img: doc/imgs_words/ch/word_1.jpg
  17. # for data or label process
  18. character_dict_path:
  19. character_type: en
  20. max_text_length: 25
  21. num_heads: 8
  22. infer_mode: False
  23. use_space_char: False
  24. Optimizer:
  25. name: Adam
  26. beta1: 0.9
  27. beta2: 0.999
  28. clip_norm: 10.0
  29. lr:
  30. learning_rate: 0.0001
  31. Architecture:
  32. model_type: rec
  33. algorithm: SRN
  34. in_channels: 1
  35. Transform:
  36. Backbone:
  37. name: ResNetFPN
  38. Head:
  39. name: SRNHead
  40. max_text_length: 25
  41. num_heads: 8
  42. num_encoder_TUs: 2
  43. num_decoder_TUs: 4
  44. hidden_dims: 512
  45. Loss:
  46. name: SRNLoss
  47. PostProcess:
  48. name: SRNLabelDecode
  49. Metric:
  50. name: RecMetric
  51. main_indicator: acc
  52. Train:
  53. dataset:
  54. name: LMDBDataSet
  55. data_dir: ./train_data/data_lmdb_release/training/
  56. transforms:
  57. - DecodeImage: # load image
  58. img_mode: BGR
  59. channel_first: False
  60. - SRNLabelEncode: # Class handling label
  61. - SRNRecResizeImg:
  62. image_shape: [1, 64, 256]
  63. - KeepKeys:
  64. keep_keys: ['image',
  65. 'label',
  66. 'length',
  67. 'encoder_word_pos',
  68. 'gsrm_word_pos',
  69. 'gsrm_slf_attn_bias1',
  70. 'gsrm_slf_attn_bias2'] # dataloader will return list in this order
  71. loader:
  72. shuffle: False
  73. batch_size_per_card: 64
  74. drop_last: False
  75. num_workers: 4
  76. Eval:
  77. dataset:
  78. name: LMDBDataSet
  79. data_dir: ./train_data/data_lmdb_release/validation/
  80. transforms:
  81. - DecodeImage: # load image
  82. img_mode: BGR
  83. channel_first: False
  84. - SRNLabelEncode: # Class handling label
  85. - SRNRecResizeImg:
  86. image_shape: [1, 64, 256]
  87. - KeepKeys:
  88. keep_keys: ['image',
  89. 'label',
  90. 'length',
  91. 'encoder_word_pos',
  92. 'gsrm_word_pos',
  93. 'gsrm_slf_attn_bias1',
  94. 'gsrm_slf_attn_bias2']
  95. loader:
  96. shuffle: False
  97. drop_last: False
  98. batch_size_per_card: 32
  99. num_workers: 4