PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

The Hmean is very high (around 93%) but can't infer anything with DB++ model. However, the infer code did great with DB

Open okusamaOwO opened this issue 9 months ago • 1 comments

This is my inference.sh: python3 ../libs/PaddleOCR/tools/export_model.py -c configs/duoc_di.yml
-o Global.save_inference_dir="./inference/det_db/"

Run inference on the exported model

python3 ../libs/PaddleOCR/tools/infer/predict_det.py
--det_model_dir="./inference/det_db/"
--image_dir="./dataset/data2/train_img/.jpg"
--det_db_thresh=0.3
--det_db_box_thresh=0.6
--det_db_unclip_ratio=2.4

And this is my config: Global: debug: false use_gpu: true epoch_num: 20 log_smooth_window: 20 print_batch_step: 10 save_model_dir: ./output/data0_td save_epoch_step: 20 eval_batch_step:

  • 0
  • 1 cal_metric_during_train: false pretrained_model: checkpoints: "./output/hivongcuoicung/best_model/model" save_inference_dir: null use_visualdl: false infer_img: doc/imgs_en/img_10.jpg save_res_path: ./checkpoints/det_db/predicts_db.txt Architecture: model_type: det algorithm: DB++ Transform: null Backbone: name: ResNet layers: 50 dcn_stage:
    • false
    • true
    • true
    • true Neck: name: DBFPN out_channels: 256 use_asf: true Head: name: DBHead k: 50 Loss: name: DBLoss balance_loss: true main_loss_type: BCELoss alpha: 5 beta: 10 ohem_ratio: 3 Optimizer: name: Momentum momentum: 0.9 lr: name: DecayLearningRate learning_rate: 0.007 epochs: 1000 factor: 0.9 end_lr: 0 weight_decay: 0.0001 PostProcess: name: DBPostProcess thresh: 0.3 box_thresh: 0.6 max_candidates: 1000 unclip_ratio: 2.4 det_box_type: quad Metric: name: DetMetric main_indicator: accuracy Train: dataset: name: SimpleDataSet data_dir: ./dataset_copy/ label_file_list:
    • ./dataset_copy/train_custom_gts.txt ratio_list:
    • 1.0 transforms:
    • DecodeImage: img_mode: BGR channel_first: false
    • DetLabelEncode: null
    • IaaAugment: augmenter_args:
      • type: Fliplr args: p: 0.5
      • type: Affine args: rotate:
        • -10
        • 10
      • type: Resize args: size:
        • 0.5
        • 3
    • EastRandomCropData: size:
      • 640
      • 640 max_tries: 10 keep_ratio: true
    • MakeShrinkMap: shrink_ratio: 0.4 min_text_size: 8
    • MakeBorderMap: shrink_ratio: 0.4 thresh_min: 0.3 thresh_max: 0.7
    • NormalizeImage: scale: 1./255. mean:
      • 0.48109378172549
      • 0.45752457890196
      • 0.40787054090196 std:
      • 1.0
      • 1.0
      • 1.0 order: hwc
    • ToCHWImage: null
    • KeepKeys: keep_keys:
      • image
      • threshold_map
      • threshold_mask
      • shrink_map
      • shrink_mask loader: shuffle: true drop_last: false batch_size_per_card: 4 num_workers: 8 Eval: dataset: name: SimpleDataSet data_dir: ./dataset_copy/ label_file_list:
    • ./dataset_copy/val_custom_gts.txt transforms:
    • DecodeImage: img_mode: BGR channel_first: false
    • DetLabelEncode: null
    • DetResizeForTest: null
    • NormalizeImage: scale: 1./255. mean:
      • 0.48109378172549
      • 0.45752457890196
      • 0.40787054090196 std:
      • 1.0
      • 1.0
      • 1.0 order: hwc
    • ToCHWImage: null
    • KeepKeys: keep_keys:
      • image
      • shape
      • polys
      • ignore_tags loader: shuffle: false drop_last: false batch_size_per_card: 1 num_workers: 2 profiler_options: null

okusamaOwO avatar May 09 '24 10:05 okusamaOwO

Hello, can you provide a picture after inference and a more detailed description of the problem? I don't understand your question a bit

UserWangZz avatar May 09 '24 12:05 UserWangZz

This issue has not been updated for a long time. This issue is temporarily closed and can be reopened if necessary.

UserWangZz avatar May 15 '24 09:05 UserWangZz