rec_r31_sar.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. Global:
  2. use_gpu: true
  3. epoch_num: 5
  4. log_smooth_window: 20
  5. print_batch_step: 20
  6. save_model_dir: ./sar_rec
  7. save_epoch_step: 1
  8. # evaluation is run every 2000 iterations
  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:
  16. # for data or label process
  17. character_dict_path: ppocr/utils/dict90.txt
  18. max_text_length: 30
  19. infer_mode: False
  20. use_space_char: False
  21. rm_symbol: True
  22. save_res_path: ./output/rec/predicts_sar.txt
  23. Optimizer:
  24. name: Adam
  25. beta1: 0.9
  26. beta2: 0.999
  27. lr:
  28. name: Piecewise
  29. decay_epochs: [3, 4]
  30. values: [0.001, 0.0001, 0.00001]
  31. regularizer:
  32. name: 'L2'
  33. factor: 0
  34. Architecture:
  35. model_type: rec
  36. algorithm: SAR
  37. Transform:
  38. Backbone:
  39. name: ResNet31
  40. Head:
  41. name: SARHead
  42. Loss:
  43. name: SARLoss
  44. PostProcess:
  45. name: SARLabelDecode
  46. Metric:
  47. name: RecMetric
  48. Train:
  49. dataset:
  50. name: SimpleDataSet
  51. label_file_list: ['./train_data/train_list.txt']
  52. data_dir: ./train_data/
  53. ratio_list: 1.0
  54. transforms:
  55. - DecodeImage: # load image
  56. img_mode: BGR
  57. channel_first: False
  58. - SARLabelEncode: # Class handling label
  59. - SARRecResizeImg:
  60. image_shape: [3, 48, 48, 160] # h:48 w:[48,160]
  61. width_downsample_ratio: 0.25
  62. - KeepKeys:
  63. keep_keys: ['image', 'label', 'valid_ratio'] # dataloader will return list in this order
  64. loader:
  65. shuffle: True
  66. batch_size_per_card: 64
  67. drop_last: True
  68. num_workers: 8
  69. use_shared_memory: False
  70. Eval:
  71. dataset:
  72. name: LMDBDataSet
  73. data_dir: ./train_data/data_lmdb_release/evaluation/
  74. transforms:
  75. - DecodeImage: # load image
  76. img_mode: BGR
  77. channel_first: False
  78. - SARLabelEncode: # Class handling label
  79. - SARRecResizeImg:
  80. image_shape: [3, 48, 48, 160]
  81. width_downsample_ratio: 0.25
  82. - KeepKeys:
  83. keep_keys: ['image', 'label', 'valid_ratio'] # dataloader will return list in this order
  84. loader:
  85. shuffle: False
  86. drop_last: False
  87. batch_size_per_card: 64
  88. num_workers: 4
  89. use_shared_memory: False