det_r50_vd_db.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. Global:
  2. use_gpu: true
  3. epoch_num: 1200
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/det_r50_vd/
  7. save_epoch_step: 1200
  8. # evaluation is run every 2000 iterations
  9. eval_batch_step: [0,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/ResNet50_vd_ssld_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: ResNet
  25. layers: 50
  26. Neck:
  27. name: DBFPN
  28. out_channels: 256
  29. Head:
  30. name: DBHead
  31. k: 50
  32. Loss:
  33. name: DBLoss
  34. balance_loss: true
  35. main_loss_type: DiceLoss
  36. alpha: 5
  37. beta: 10
  38. ohem_ratio: 3
  39. Optimizer:
  40. name: Adam
  41. beta1: 0.9
  42. beta2: 0.999
  43. lr:
  44. learning_rate: 0.001
  45. regularizer:
  46. name: 'L2'
  47. factor: 0
  48. PostProcess:
  49. name: DBPostProcess
  50. thresh: 0.3
  51. box_thresh: 0.7
  52. max_candidates: 1000
  53. unclip_ratio: 1.5
  54. Metric:
  55. name: DetMetric
  56. main_indicator: hmean
  57. Train:
  58. dataset:
  59. name: SimpleDataSet
  60. data_dir: ./train_data/icdar2015/text_localization/
  61. label_file_list:
  62. - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
  63. ratio_list: [1.0]
  64. transforms:
  65. - DecodeImage: # load image
  66. img_mode: BGR
  67. channel_first: False
  68. - DetLabelEncode: # Class handling label
  69. - IaaAugment:
  70. augmenter_args:
  71. - { 'type': Fliplr, 'args': { 'p': 0.5 } }
  72. - { 'type': Affine, 'args': { 'rotate': [-10, 10] } }
  73. - { 'type': Resize, 'args': { 'size': [0.5, 3] } }
  74. - EastRandomCropData:
  75. size: [640, 640]
  76. max_tries: 50
  77. keep_ratio: true
  78. - MakeBorderMap:
  79. shrink_ratio: 0.4
  80. thresh_min: 0.3
  81. thresh_max: 0.7
  82. - MakeShrinkMap:
  83. shrink_ratio: 0.4
  84. min_text_size: 8
  85. - NormalizeImage:
  86. scale: 1./255.
  87. mean: [0.485, 0.456, 0.406]
  88. std: [0.229, 0.224, 0.225]
  89. order: 'hwc'
  90. - ToCHWImage:
  91. - KeepKeys:
  92. keep_keys: ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask'] # the order of the dataloader list
  93. loader:
  94. shuffle: True
  95. drop_last: False
  96. batch_size_per_card: 16
  97. num_workers: 8
  98. Eval:
  99. dataset:
  100. name: SimpleDataSet
  101. data_dir: ./train_data/icdar2015/text_localization/
  102. label_file_list:
  103. - ./train_data/icdar2015/text_localization/test_icdar2015_label.txt
  104. transforms:
  105. - DecodeImage: # load image
  106. img_mode: BGR
  107. channel_first: False
  108. - DetLabelEncode: # Class handling label
  109. - DetResizeForTest:
  110. image_shape: [736, 1280]
  111. - NormalizeImage:
  112. scale: 1./255.
  113. mean: [0.485, 0.456, 0.406]
  114. std: [0.229, 0.224, 0.225]
  115. order: 'hwc'
  116. - ToCHWImage:
  117. - KeepKeys:
  118. keep_keys: ['image', 'shape', 'polys', 'ignore_tags']
  119. loader:
  120. shuffle: False
  121. drop_last: False
  122. batch_size_per_card: 1 # must be 1
  123. num_workers: 8