rec_multi_language_lite_train.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. Global:
  2. use_gpu: True
  3. epoch_num: 500
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/rec_multi_language_lite
  7. save_epoch_step: 3
  8. # evaluation is run every 5000 iterations after the 4000th iteration
  9. eval_batch_step: [0, 2000]
  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:
  17. # for data or label process
  18. character_dict_path:
  19. # Set the language of training, if set, select the default dictionary file
  20. character_type:
  21. max_text_length: 25
  22. infer_mode: False
  23. use_space_char: True
  24. Optimizer:
  25. name: Adam
  26. beta1: 0.9
  27. beta2: 0.999
  28. lr:
  29. name: Cosine
  30. learning_rate: 0.001
  31. regularizer:
  32. name: 'L2'
  33. factor: 0.00001
  34. Architecture:
  35. model_type: rec
  36. algorithm: CRNN
  37. Transform:
  38. Backbone:
  39. name: MobileNetV3
  40. scale: 0.5
  41. model_name: small
  42. small_stride: [1, 2, 2, 2]
  43. Neck:
  44. name: SequenceEncoder
  45. encoder_type: rnn
  46. hidden_size: 48
  47. Head:
  48. name: CTCHead
  49. fc_decay: 0.00001
  50. Loss:
  51. name: CTCLoss
  52. PostProcess:
  53. name: CTCLabelDecode
  54. Metric:
  55. name: RecMetric
  56. main_indicator: acc
  57. Train:
  58. dataset:
  59. name: SimpleDataSet
  60. data_dir: train_data/
  61. label_file_list: ["./train_data/train_list.txt"]
  62. transforms:
  63. - DecodeImage: # load image
  64. img_mode: BGR
  65. channel_first: False
  66. - RecAug:
  67. - CTCLabelEncode: # Class handling label
  68. - RecResizeImg:
  69. image_shape: [3, 32, 320]
  70. - KeepKeys:
  71. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  72. loader:
  73. shuffle: True
  74. batch_size_per_card: 256
  75. drop_last: True
  76. num_workers: 8
  77. Eval:
  78. dataset:
  79. name: SimpleDataSet
  80. data_dir: train_data/
  81. label_file_list: ["./train_data/val_list.txt"]
  82. transforms:
  83. - DecodeImage: # load image
  84. img_mode: BGR
  85. channel_first: False
  86. - CTCLabelEncode: # Class handling label
  87. - RecResizeImg:
  88. image_shape: [3, 32, 320]
  89. - KeepKeys:
  90. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  91. loader:
  92. shuffle: False
  93. drop_last: False
  94. batch_size_per_card: 256
  95. num_workers: 8