rec_german_lite_train.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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_german_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: ppocr/utils/dict/german_dict.txt
  19. max_text_length: 25
  20. infer_mode: False
  21. use_space_char: False
  22. Optimizer:
  23. name: Adam
  24. beta1: 0.9
  25. beta2: 0.999
  26. lr:
  27. name: Cosine
  28. learning_rate: 0.001
  29. regularizer:
  30. name: 'L2'
  31. factor: 0.00001
  32. Architecture:
  33. model_type: rec
  34. algorithm: CRNN
  35. Transform:
  36. Backbone:
  37. name: MobileNetV3
  38. scale: 0.5
  39. model_name: small
  40. small_stride: [1, 2, 2, 2]
  41. Neck:
  42. name: SequenceEncoder
  43. encoder_type: rnn
  44. hidden_size: 48
  45. Head:
  46. name: CTCHead
  47. fc_decay: 0.00001
  48. Loss:
  49. name: CTCLoss
  50. PostProcess:
  51. name: CTCLabelDecode
  52. Metric:
  53. name: RecMetric
  54. main_indicator: acc
  55. Train:
  56. dataset:
  57. name: SimpleDataSet
  58. data_dir: ./train_data/
  59. label_file_list: ["./train_data/train_list.txt"]
  60. transforms:
  61. - DecodeImage: # load image
  62. img_mode: BGR
  63. channel_first: False
  64. - RecAug:
  65. - CTCLabelEncode: # Class handling label
  66. - RecResizeImg:
  67. image_shape: [3, 32, 320]
  68. - KeepKeys:
  69. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  70. loader:
  71. shuffle: True
  72. batch_size_per_card: 256
  73. drop_last: True
  74. num_workers: 8
  75. Eval:
  76. dataset:
  77. name: SimpleDataSet
  78. data_dir: ./train_data/
  79. label_file_list: ["./train_data/eval_list.txt"]
  80. transforms:
  81. - DecodeImage: # load image
  82. img_mode: BGR
  83. channel_first: False
  84. - CTCLabelEncode: # Class handling label
  85. - RecResizeImg:
  86. image_shape: [3, 32, 320]
  87. - KeepKeys:
  88. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  89. loader:
  90. shuffle: False
  91. drop_last: False
  92. batch_size_per_card: 256
  93. num_workers: 8