det_r50_vd_pse.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. Global:
  2. use_gpu: true
  3. epoch_num: 600
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/det_r50_vd_pse/
  7. save_epoch_step: 600
  8. # evaluation is run every 125 iterations
  9. eval_batch_step: [ 0,125 ]
  10. cal_metric_during_train: False
  11. pretrained_model: ./pretrain_models/ResNet50_vd_ssld_pretrained
  12. checkpoints: #./output/det_r50_vd_pse_batch8_ColorJitter/best_accuracy
  13. save_inference_dir:
  14. use_visualdl: False
  15. infer_img: doc/imgs_en/img_10.jpg
  16. save_res_path: ./output/det_pse/predicts_pse.txt
  17. Architecture:
  18. model_type: det
  19. algorithm: PSE
  20. Transform:
  21. Backbone:
  22. name: ResNet_vd
  23. layers: 50
  24. Neck:
  25. name: FPN
  26. out_channels: 256
  27. Head:
  28. name: PSEHead
  29. hidden_dim: 256
  30. out_channels: 7
  31. Loss:
  32. name: PSELoss
  33. alpha: 0.7
  34. ohem_ratio: 3
  35. kernel_sample_mask: pred
  36. reduction: none
  37. Optimizer:
  38. name: Adam
  39. beta1: 0.9
  40. beta2: 0.999
  41. lr:
  42. name: Step
  43. learning_rate: 0.0001
  44. step_size: 200
  45. gamma: 0.1
  46. regularizer:
  47. name: 'L2'
  48. factor: 0.0005
  49. PostProcess:
  50. name: PSEPostProcess
  51. thresh: 0
  52. box_thresh: 0.85
  53. min_area: 16
  54. box_type: quad # 'quad' or 'poly'
  55. scale: 1
  56. Metric:
  57. name: DetMetric
  58. main_indicator: hmean
  59. Train:
  60. dataset:
  61. name: SimpleDataSet
  62. data_dir: ./train_data/icdar2015/text_localization/
  63. label_file_list:
  64. - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
  65. ratio_list: [ 1.0 ]
  66. transforms:
  67. - DecodeImage: # load image
  68. img_mode: BGR
  69. channel_first: False
  70. - DetLabelEncode: # Class handling label
  71. - ColorJitter:
  72. brightness: 0.12549019607843137
  73. saturation: 0.5
  74. - IaaAugment:
  75. augmenter_args:
  76. - { 'type': Resize, 'args': { 'size': [ 0.5, 3 ] } }
  77. - { 'type': Fliplr, 'args': { 'p': 0.5 } }
  78. - { 'type': Affine, 'args': { 'rotate': [ -10, 10 ] } }
  79. - MakePseGt:
  80. kernel_num: 7
  81. min_shrink_ratio: 0.4
  82. size: 640
  83. - RandomCropImgMask:
  84. size: [ 640,640 ]
  85. main_key: gt_text
  86. crop_keys: [ 'image', 'gt_text', 'gt_kernels', 'mask' ]
  87. - NormalizeImage:
  88. scale: 1./255.
  89. mean: [ 0.485, 0.456, 0.406 ]
  90. std: [ 0.229, 0.224, 0.225 ]
  91. order: 'hwc'
  92. - ToCHWImage:
  93. - KeepKeys:
  94. keep_keys: [ 'image', 'gt_text', 'gt_kernels', 'mask' ] # the order of the dataloader list
  95. loader:
  96. shuffle: True
  97. drop_last: False
  98. batch_size_per_card: 8
  99. num_workers: 8
  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. ratio_list: [ 1.0 ]
  107. transforms:
  108. - DecodeImage: # load image
  109. img_mode: BGR
  110. channel_first: False
  111. - DetLabelEncode: # Class handling label
  112. - DetResizeForTest:
  113. limit_side_len: 736
  114. limit_type: min
  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: 8