ch_PP-OCRv2_det_student.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. Global:
  2. use_gpu: true
  3. epoch_num: 1200
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/ch_db_mv3/
  7. save_epoch_step: 1200
  8. # evaluation is run every 5000 iterations after the 4000th iteration
  9. eval_batch_step: [0, 400]
  10. cal_metric_during_train: False
  11. pretrained_model: ./pretrain_models/student.pdparams
  12. checkpoints:
  13. save_inference_dir:
  14. use_visualdl: False
  15. infer_img: doc/imgs_en/img_10.jpg
  16. save_res_path: ./output/det_db/predicts_db.txt
  17. Architecture:
  18. model_type: det
  19. algorithm: DB
  20. Transform:
  21. Backbone:
  22. name: MobileNetV3
  23. scale: 0.5
  24. model_name: large
  25. disable_se: True
  26. Neck:
  27. name: DBFPN
  28. out_channels: 96
  29. Head:
  30. name: DBHead
  31. k: 50
  32. Loss:
  33. name: DBLoss
  34. balance_loss: true
  35. main_loss_type: DiceLoss
  36. alpha: 5
  37. beta: 10
  38. ohem_ratio: 3
  39. Optimizer:
  40. name: Adam
  41. beta1: 0.9
  42. beta2: 0.999
  43. lr:
  44. name: Cosine
  45. learning_rate: 0.001
  46. warmup_epoch: 2
  47. regularizer:
  48. name: 'L2'
  49. factor: 0
  50. PostProcess:
  51. name: DBPostProcess
  52. thresh: 0.3
  53. box_thresh: 0.6
  54. max_candidates: 1000
  55. unclip_ratio: 1.5
  56. Metric:
  57. name: DetMetric
  58. main_indicator: hmean
  59. Train:
  60. dataset:
  61. name: SimpleDataSet
  62. data_dir: ./train_data/icdar2015/text_localization/
  63. label_file_list:
  64. - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
  65. ratio_list: [1.0]
  66. transforms:
  67. - DecodeImage: # load image
  68. img_mode: BGR
  69. channel_first: False
  70. - DetLabelEncode: # Class handling label
  71. - IaaAugment:
  72. augmenter_args:
  73. - { 'type': Fliplr, 'args': { 'p': 0.5 } }
  74. - { 'type': Affine, 'args': { 'rotate': [-10, 10] } }
  75. - { 'type': Resize, 'args': { 'size': [0.5, 3] } }
  76. - EastRandomCropData:
  77. size: [960, 960]
  78. max_tries: 50
  79. keep_ratio: true
  80. - MakeBorderMap:
  81. shrink_ratio: 0.4
  82. thresh_min: 0.3
  83. thresh_max: 0.7
  84. - MakeShrinkMap:
  85. shrink_ratio: 0.4
  86. min_text_size: 8
  87. - NormalizeImage:
  88. scale: 1./255.
  89. mean: [0.485, 0.456, 0.406]
  90. std: [0.229, 0.224, 0.225]
  91. order: 'hwc'
  92. - ToCHWImage:
  93. - KeepKeys:
  94. keep_keys: ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask'] # the order of the dataloader list
  95. loader:
  96. shuffle: True
  97. drop_last: False
  98. batch_size_per_card: 8
  99. num_workers: 4
  100. Eval:
  101. dataset:
  102. name: SimpleDataSet
  103. data_dir: ./train_data/icdar2015/text_localization/
  104. label_file_list:
  105. - ./train_data/icdar2015/text_localization/test_icdar2015_label.txt
  106. transforms:
  107. - DecodeImage: # load image
  108. img_mode: BGR
  109. channel_first: False
  110. - DetLabelEncode: # Class handling label
  111. - DetResizeForTest:
  112. # image_shape: [736, 1280]
  113. - NormalizeImage:
  114. scale: 1./255.
  115. mean: [0.485, 0.456, 0.406]
  116. std: [0.229, 0.224, 0.225]
  117. order: 'hwc'
  118. - ToCHWImage:
  119. - KeepKeys:
  120. keep_keys: ['image', 'shape', 'polys', 'ignore_tags']
  121. loader:
  122. shuffle: False
  123. drop_last: False
  124. batch_size_per_card: 1 # must be 1
  125. num_workers: 2