rec_chinese_common_train_v2.0.yml 2.2 KB

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