my_chinese_lite_cpu.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Global:
  2. use_gpu: False
  3. epoch_num: 10
  4. log_smooth_window: 20
  5. print_batch_step: 1
  6. save_model_dir: output/rec/my_rec_chinese_lite/
  7. save_epoch_step: 5
  8. # evaluation is run every 2000 iterations
  9. eval_batch_step: [0, 150000]
  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: output/rec/my_rec_chinese_lite/best_accuracy
  13. checkpoints:
  14. save_inference_dir:
  15. use_visualdl: False
  16. infer_img: doc/imgs_words_en/word_10.png
  17. # for data or label process
  18. character_dict_path: ppocr/utils/ppocr_keys_v1.txt
  19. character_type: ch
  20. max_text_length: 128
  21. infer_mode: False
  22. use_space_char: True
  23. distributed: True
  24. Optimizer:
  25. name: Adam
  26. beta1: 0.9
  27. beta2: 0.999
  28. lr:
  29. name: Cosine
  30. learning_rate: 0.0000001
  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/bidi_data/orgs_data/
  61. label_file_list: ["./train_data/bidi_data/orgs_data/rec_gt_train.txt"]
  62. transforms:
  63. - DecodeImage: # load image
  64. img_mode: BGR
  65. channel_first: False
  66. - CTCLabelEncode: # Class handling label
  67. - RecResizeImg:
  68. image_shape: [3, 32, 1000]
  69. - KeepKeys:
  70. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  71. loader:
  72. shuffle: True
  73. batch_size_per_card: 100
  74. drop_last: True
  75. num_workers: 16
  76. Eval:
  77. dataset:
  78. name: SimpleDataSet
  79. data_dir: train_data/bidi_data/orgs_data/
  80. label_file_list: ["./train_data/bidi_data/orgs_data/rec_gt_test.txt"]
  81. transforms:
  82. - DecodeImage: # load image
  83. img_mode: BGR
  84. channel_first: False
  85. - CTCLabelEncode: # Class handling label
  86. - RecResizeImg:
  87. image_shape: [3, 32, 1000]
  88. - KeepKeys:
  89. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  90. loader:
  91. shuffle: False
  92. drop_last: False
  93. batch_size_per_card: 100
  94. num_workers: 16