det_r50_db++_td_tr.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. Global:
  2. debug: false
  3. use_gpu: true
  4. epoch_num: 1000
  5. log_smooth_window: 20
  6. print_batch_step: 10
  7. save_model_dir: ./output/det_r50_td_tr/
  8. save_epoch_step: 200
  9. eval_batch_step:
  10. - 0
  11. - 2000
  12. cal_metric_during_train: false
  13. pretrained_model: ./pretrain_models/ResNet50_dcn_asf_synthtext_pretrained
  14. checkpoints: null
  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. Architecture:
  20. model_type: det
  21. algorithm: DB++
  22. Transform: null
  23. Backbone:
  24. name: ResNet
  25. layers: 50
  26. dcn_stage: [False, True, True, True]
  27. Neck:
  28. name: DBFPN
  29. out_channels: 256
  30. use_asf: True
  31. Head:
  32. name: DBHead
  33. k: 50
  34. Loss:
  35. name: DBLoss
  36. balance_loss: true
  37. main_loss_type: BCELoss
  38. alpha: 5
  39. beta: 10
  40. ohem_ratio: 3
  41. Optimizer:
  42. name: Momentum
  43. momentum: 0.9
  44. lr:
  45. name: DecayLearningRate
  46. learning_rate: 0.007
  47. epochs: 1000
  48. factor: 0.9
  49. end_lr: 0
  50. weight_decay: 0.0001
  51. PostProcess:
  52. name: DBPostProcess
  53. thresh: 0.3
  54. box_thresh: 0.5
  55. max_candidates: 1000
  56. unclip_ratio: 1.5
  57. det_box_type: 'quad' # 'quad' or 'poly'
  58. Metric:
  59. name: DetMetric
  60. main_indicator: hmean
  61. Train:
  62. dataset:
  63. name: SimpleDataSet
  64. data_dir: ./train_data/
  65. label_file_list:
  66. - ./train_data/TD_TR/TD500/train_gt_labels.txt
  67. - ./train_data/TD_TR/TR400/gt_labels.txt
  68. ratio_list:
  69. - 1.0
  70. - 1.0
  71. transforms:
  72. - DecodeImage:
  73. img_mode: BGR
  74. channel_first: false
  75. - DetLabelEncode: null
  76. - IaaAugment:
  77. augmenter_args:
  78. - type: Fliplr
  79. args:
  80. p: 0.5
  81. - type: Affine
  82. args:
  83. rotate:
  84. - -10
  85. - 10
  86. - type: Resize
  87. args:
  88. size:
  89. - 0.5
  90. - 3
  91. - EastRandomCropData:
  92. size:
  93. - 640
  94. - 640
  95. max_tries: 10
  96. keep_ratio: true
  97. - MakeShrinkMap:
  98. shrink_ratio: 0.4
  99. min_text_size: 8
  100. - MakeBorderMap:
  101. shrink_ratio: 0.4
  102. thresh_min: 0.3
  103. thresh_max: 0.7
  104. - NormalizeImage:
  105. scale: 1./255.
  106. mean:
  107. - 0.48109378172549
  108. - 0.45752457890196
  109. - 0.40787054090196
  110. std:
  111. - 1.0
  112. - 1.0
  113. - 1.0
  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: 4
  127. num_workers: 8
  128. Eval:
  129. dataset:
  130. name: SimpleDataSet
  131. data_dir: ./train_data/
  132. label_file_list:
  133. - ./train_data/TD_TR/TD500/test_gt_labels.txt
  134. transforms:
  135. - DecodeImage:
  136. img_mode: BGR
  137. channel_first: false
  138. - DetLabelEncode: null
  139. - DetResizeForTest:
  140. image_shape:
  141. - 736
  142. - 736
  143. keep_ratio: True
  144. - NormalizeImage:
  145. scale: 1./255.
  146. mean:
  147. - 0.48109378172549
  148. - 0.45752457890196
  149. - 0.40787054090196
  150. std:
  151. - 1.0
  152. - 1.0
  153. - 1.0
  154. order: hwc
  155. - ToCHWImage: null
  156. - KeepKeys:
  157. keep_keys:
  158. - image
  159. - shape
  160. - polys
  161. - ignore_tags
  162. loader:
  163. shuffle: false
  164. drop_last: false
  165. batch_size_per_card: 1
  166. num_workers: 2
  167. profiler_options: null