ch_det_mv3_db_v2.0.yml 3.3 KB

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