det_mv3_db.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. Global:
  2. use_gpu: true
  3. use_xpu: false
  4. use_mlu: false
  5. epoch_num: 1200
  6. log_smooth_window: 20
  7. print_batch_step: 10
  8. save_model_dir: ./output/db_mv3/
  9. save_epoch_step: 1200
  10. # evaluation is run every 2000 iterations
  11. eval_batch_step: [0, 2000]
  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. Neck:
  28. name: DBFPN
  29. out_channels: 256
  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. learning_rate: 0.001
  46. regularizer:
  47. name: 'L2'
  48. factor: 0
  49. PostProcess:
  50. name: DBPostProcess
  51. thresh: 0.3
  52. box_thresh: 0.6
  53. max_candidates: 1000
  54. unclip_ratio: 1.5
  55. Metric:
  56. name: DetMetric
  57. main_indicator: hmean
  58. Train:
  59. dataset:
  60. name: SimpleDataSet
  61. data_dir: ./train_data/icdar2015/text_localization/
  62. label_file_list:
  63. - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
  64. ratio_list: [1.0]
  65. transforms:
  66. - DecodeImage: # load image
  67. img_mode: BGR
  68. channel_first: False
  69. - DetLabelEncode: # Class handling label
  70. - IaaAugment:
  71. augmenter_args:
  72. - { 'type': Fliplr, 'args': { 'p': 0.5 } }
  73. - { 'type': Affine, 'args': { 'rotate': [-10, 10] } }
  74. - { 'type': Resize, 'args': { 'size': [0.5, 3] } }
  75. - EastRandomCropData:
  76. size: [640, 640]
  77. max_tries: 50
  78. keep_ratio: true
  79. - MakeBorderMap:
  80. shrink_ratio: 0.4
  81. thresh_min: 0.3
  82. thresh_max: 0.7
  83. - MakeShrinkMap:
  84. shrink_ratio: 0.4
  85. min_text_size: 8
  86. - NormalizeImage:
  87. scale: 1./255.
  88. mean: [0.485, 0.456, 0.406]
  89. std: [0.229, 0.224, 0.225]
  90. order: 'hwc'
  91. - ToCHWImage:
  92. - KeepKeys:
  93. keep_keys: ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask'] # the order of the dataloader list
  94. loader:
  95. shuffle: True
  96. drop_last: False
  97. batch_size_per_card: 16
  98. num_workers: 8
  99. use_shared_memory: True
  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: 8
  126. use_shared_memory: True