RepSVTR_mobile_det.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. Global:
  2. debug: false
  3. use_gpu: true
  4. epoch_num: &epoch_num 500
  5. log_smooth_window: 20
  6. print_batch_step: 100
  7. save_model_dir: ./output/det_repsvtr_db
  8. save_epoch_step: 10
  9. eval_batch_step:
  10. - 0
  11. - 1000
  12. cal_metric_during_train: false
  13. checkpoints:
  14. pretrained_model: https://paddleocr.bj.bcebos.com/pretrained/ch_SVTR_det_mobile_trained.pdparams
  15. save_inference_dir: null
  16. use_visualdl: false
  17. infer_img: doc/imgs_en/img_10.jpg
  18. save_res_path: ./checkpoints/det_db/predicts_db.txt
  19. distributed: true
  20. Architecture:
  21. model_type: det
  22. algorithm: DB
  23. Transform: null
  24. Backbone:
  25. name: RepSVTR_det
  26. Neck:
  27. name: RSEFPN
  28. out_channels: 96
  29. shortcut: True
  30. Head:
  31. name: DBHead
  32. k: 50
  33. Loss:
  34. name: DBLoss
  35. balance_loss: true
  36. main_loss_type: DiceLoss
  37. alpha: 5
  38. beta: 10
  39. ohem_ratio: 3
  40. Optimizer:
  41. name: Adam
  42. beta1: 0.9
  43. beta2: 0.999
  44. lr:
  45. name: Cosine
  46. learning_rate: 0.001 #(8*8c)
  47. warmup_epoch: 2
  48. regularizer:
  49. name: L2
  50. factor: 5.0e-05
  51. PostProcess:
  52. name: DBPostProcess
  53. thresh: 0.3
  54. box_thresh: 0.6
  55. max_candidates: 1000
  56. unclip_ratio: 1.5
  57. Metric:
  58. name: DetMetric
  59. main_indicator: hmean
  60. Train:
  61. dataset:
  62. name: SimpleDataSet
  63. data_dir: ./train_data/icdar2015/text_localization/
  64. label_file_list:
  65. - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
  66. ratio_list: [1.0]
  67. transforms:
  68. - DecodeImage:
  69. img_mode: BGR
  70. channel_first: false
  71. - DetLabelEncode: null
  72. - CopyPaste: null
  73. - IaaAugment:
  74. augmenter_args:
  75. - type: Fliplr
  76. args:
  77. p: 0.5
  78. - type: Affine
  79. args:
  80. rotate:
  81. - -10
  82. - 10
  83. - type: Resize
  84. args:
  85. size:
  86. - 0.5
  87. - 3
  88. - EastRandomCropData:
  89. size:
  90. - 640
  91. - 640
  92. max_tries: 50
  93. keep_ratio: true
  94. - MakeBorderMap:
  95. shrink_ratio: 0.4
  96. thresh_min: 0.3
  97. thresh_max: 0.7
  98. total_epoch: *epoch_num
  99. - MakeShrinkMap:
  100. shrink_ratio: 0.4
  101. min_text_size: 8
  102. total_epoch: *epoch_num
  103. - NormalizeImage:
  104. scale: 1./255.
  105. mean:
  106. - 0.485
  107. - 0.456
  108. - 0.406
  109. std:
  110. - 0.229
  111. - 0.224
  112. - 0.225
  113. order: hwc
  114. - ToCHWImage: null
  115. - KeepKeys:
  116. keep_keys:
  117. - image
  118. - threshold_map
  119. - threshold_mask
  120. - shrink_map
  121. - shrink_mask
  122. loader:
  123. shuffle: true
  124. drop_last: false
  125. batch_size_per_card: 8
  126. num_workers: 8
  127. Eval:
  128. dataset:
  129. name: SimpleDataSet
  130. data_dir: ./train_data/icdar2015/text_localization/
  131. label_file_list:
  132. - ./train_data/icdar2015/text_localization/test_icdar2015_label.txt
  133. transforms:
  134. - DecodeImage:
  135. img_mode: BGR
  136. channel_first: false
  137. - DetLabelEncode: null
  138. - DetResizeForTest:
  139. - NormalizeImage:
  140. scale: 1./255.
  141. mean:
  142. - 0.485
  143. - 0.456
  144. - 0.406
  145. std:
  146. - 0.229
  147. - 0.224
  148. - 0.225
  149. order: hwc
  150. - ToCHWImage: null
  151. - KeepKeys:
  152. keep_keys:
  153. - image
  154. - shape
  155. - polys
  156. - ignore_tags
  157. loader:
  158. shuffle: false
  159. drop_last: false
  160. batch_size_per_card: 1
  161. num_workers: 2
  162. profiler_options: null