PP-OCRv5_mobile_det.yaml 3.1 KB

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