PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.23k stars 7.82k forks source link

eval PP-OCRv4_det warning #11960

Closed SophiaSarah closed 6 months ago

SophiaSarah commented 7 months ago

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

Sunting78 commented 7 months ago

您好,可以给下运行命令。pretrain_model换为训练好的模型,checkpoint也换为训练好的模型。再试试看

SophiaSarah commented 7 months ago

您好,可以给下运行命令。pretrain_model换为训练好的模型,checkpoint也换为训练好的模型。再试试看

python3 tools/eval.py -c configs/det/det_PP-OCRv4_db.yml 其中det_PP-OCRv4_db.yml内容如下

Global:
  use_gpu: true
  use_xpu: false
  use_mlu: false
  epoch_num: 1200
  log_smooth_window: 20
  print_batch_step: 10
  save_model_dir: ./output/ch_PP-OCRv4/
  save_epoch_step: 1200
  # evaluation is run every 2000 iterations
  eval_batch_step: [0, 2000]
  cal_metric_during_train: False
  pretrained_model: null
  checkpoints: ./models/ch_PP-OCRv4_det_train/best_accuracy.pdparams
  save_inference_dir:
  use_visualdl: False
  infer_img: doc/imgs_en/img_10.jpg
  save_res_path: ./output/det_db/predicts_db.txt
  distributed: false

Architecture:
  model_type: det
  algorithm: DB
  Transform:
  Backbone:
    name: PPLCNetV3
    scale: 0.75
    pretrained: false
    det: true
  Neck:
    name: RSEFPN
    out_channels: 96
    shortcut: true
  Head:
    name: DBHead
    k: 50

Loss:
  name: DBLoss
  balance_loss: true
  main_loss_type: DiceLoss
  alpha: 5
  beta: 10
  ohem_ratio: 3

Optimizer:
  name: Adam
  beta1: 0.9
  beta2: 0.999
  lr:
    learning_rate: 0.001
  regularizer:
    name: 'L2'
    factor: 0

PostProcess:
  name: DBPostProcess
  thresh: 0.3
  box_thresh: 0.6
  max_candidates: 1000
  unclip_ratio: 1.5

Metric:
  name: DetMetric
  main_indicator: hmean

Train:
  dataset:
    name: SimpleDataSet
    data_dir: ***********
    label_file_list:
      - **********
    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: 50
        keep_ratio: true
    - MakeBorderMap:
        shrink_ratio: 0.4
        thresh_min: 0.3
        thresh_max: 0.7
        total_epoch: 500
    - MakeShrinkMap:
        shrink_ratio: 0.4
        min_text_size: 8
        total_epoch: 500
    - NormalizeImage:
        scale: 1./255.
        mean:
        - 0.485
        - 0.456
        - 0.406
        std:
        - 0.229
        - 0.224
        - 0.225
        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: 16
    num_workers: 8
    use_shared_memory: True
  sampler:
    name: BatchSampler
Eval:
  dataset:
    name: SimpleDataSet
    data_dir:*********
    label_file_list:
      - ***********
    transforms:
    - DecodeImage:
        img_mode: BGR
        channel_first: false
    - DetLabelEncode: null
    - DetResizeForTest: null
    - NormalizeImage:
        scale: 1./255.
        mean:
        - 0.485
        - 0.456
        - 0.406
        std:
        - 0.229
        - 0.224
        - 0.225
        order: hwc
    - ToCHWImage: null
    - KeepKeys:
        keep_keys:
        - image
        - shape
        - polys
        - ignore_tags
  loader:
    shuffle: False
    drop_last: False
    batch_size_per_card: 1 # must be 1
    num_workers: 8
    use_shared_memory: True
  sampler:
    name: BatchSampler

checkpoints为 https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_det_train.tar

Sunting78 commented 6 months ago

您好配置文件请使用这个目录下的文件 https://github.com/PaddlePaddle/PaddleOCR/tree/main/configs/det/ch_PP-OCRv4 如果是轻量模型选择student,服务端选择teacher的配置文件

HonestyBrave commented 2 months ago

您好配置文件请使用这个目录下的文件 https://github.com/PaddlePaddle/PaddleOCR/tree/main/configs/det/ch_PP-OCRv4 如果是轻量模型选择student,服务端选择teacher的配置文件

请问,cml这个文件对应哪个预训练模型?