Sfoglia il codice sorgente

Rename SVTRv2 and delete repsvtr det model (#1925)

* add SVTRv2 from PaddleOCR

* rename svtrv2 and del det model
WangZ 1 anno fa
parent
commit
4730520430

+ 0 - 37
paddlex/configs/text_detection/RepSVTR_mobile_det.yaml

@@ -1,37 +0,0 @@
-Global:
-  model: RepSVTR_mobile_det
-  mode: check_dataset # check_dataset/train/evaluate/predict
-  module: text_det
-  dataset_dir: "/paddle/dataset/paddlex/ocr_det/ocr_det_dataset_examples"
-  device: gpu:0,1,2,3
-  output: "output"
-
-CheckDataset:
-  convert:
-    enable: False
-    src_dataset_type: null
-  split:
-    enable: False
-    train_percent: null
-    val_percent: null
-
-Train:
-  epochs_iters: 100
-  batch_size: 4
-  learning_rate: 0.001
-  pretrain_weight_path: null
-  resume_path: null
-  log_interval: 10
-  eval_interval: 1
-  save_interval: 1
-
-Evaluate:
-  weight_path: "output/best_accuracy.pdparams"
-  log_interval: 1
-
-Predict:
-  model_dir: "output/best_accuracy"
-  input_path: "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_001.png"
-  kernel_option:
-    run_mode: paddle
-    batch_size: 1

+ 1 - 1
paddlex/configs/text_recognition/SVTRv2_server_rec.yaml → paddlex/configs/text_recognition/ch_RepSVTR_rec.yaml

@@ -1,5 +1,5 @@
 Global:
-  model: SVTRv2_server_rec
+  model: ch_RepSVTR_rec
   mode: check_dataset # check_dataset/train/evaluate/predict
   dataset_dir: "/paddle/dataset/paddlex/ocr_rec/ocr_rec_dataset_examples"
   device: gpu:0,1,2,3

+ 1 - 1
paddlex/configs/text_recognition/RepSVTR_mobile_rec.yaml → paddlex/configs/text_recognition/ch_SVTRv2_rec.yaml

@@ -1,5 +1,5 @@
 Global:
-  model: RepSVTR_mobile_rec
+  model: ch_SVTRv2_rec
   mode: check_dataset # check_dataset/train/evaluate/predict
   dataset_dir: "/paddle/dataset/paddlex/ocr_rec/ocr_rec_dataset_examples"
   device: gpu:0,1,2,3

+ 0 - 3
paddlex/modules/base/predictor/utils/official_models.py

@@ -263,9 +263,6 @@ PP-OCRv4_server_det_infer.tar",
     "PP-OCRv4_mobile_det":
     "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0/\
 PP-OCRv4_mobile_det_infer.tar",
-    "RepSVTR_mobile_det":
-    "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0/\
-openatom_det_repsvtr_ch_infer.tar",
     "RepSVTR_mobile_rec":
     "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0/\
 openatom_rec_repsvtr_ch_infer.tar",

+ 0 - 1
paddlex/modules/text_detection/model_list.py

@@ -15,5 +15,4 @@
 MODELS = [
     'PP-OCRv4_mobile_det',
     'PP-OCRv4_server_det',
-    'RepSVTR_mobile_det',
 ]

+ 2 - 2
paddlex/modules/text_recognition/model_list.py

@@ -15,7 +15,7 @@
 MODELS = [
     'PP-OCRv4_mobile_rec',
     'PP-OCRv4_server_rec',
-    'SVTRv2_server_rec',
-    'RepSVTR_mobile_rec',
+    'ch_SVTRv2_rec',
+    'ch_RepSVTR_rec',
     'LaTeX_OCR_rec',
 ]

+ 0 - 169
paddlex/repo_apis/PaddleOCR_api/configs/RepSVTR_mobile_det.yaml

@@ -1,169 +0,0 @@
-Global:
-  debug: false
-  use_gpu: true
-  epoch_num: &epoch_num 500
-  log_smooth_window: 20
-  print_batch_step: 100
-  save_model_dir: ./output/det_repsvtr_db
-  save_epoch_step: 10
-  eval_batch_step:
-  - 0
-  - 1000
-  cal_metric_during_train: false
-  checkpoints:
-  pretrained_model: https://paddleocr.bj.bcebos.com/pretrained/ch_SVTR_det_mobile_trained.pdparams
-  save_inference_dir: null
-  use_visualdl: false
-  infer_img: doc/imgs_en/img_10.jpg
-  save_res_path: ./checkpoints/det_db/predicts_db.txt
-  distributed: true
-
-Architecture:
-  model_type: det
-  algorithm: DB
-  Transform: null
-  Backbone:
-    name: RepSVTR_det
-  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:
-    name: Cosine
-    learning_rate: 0.001 #(8*8c)
-    warmup_epoch: 2
-  regularizer:
-    name: L2
-    factor: 5.0e-05
-
-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: ./train_data/icdar2015/text_localization/
-    label_file_list:
-      - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
-    ratio_list: [1.0]
-    transforms:
-    - DecodeImage:
-        img_mode: BGR
-        channel_first: false
-    - DetLabelEncode: null
-    - CopyPaste: 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: *epoch_num
-    - MakeShrinkMap:
-        shrink_ratio: 0.4
-        min_text_size: 8
-        total_epoch: *epoch_num
-    - 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: 8
-    num_workers: 8
-
-Eval:
-  dataset:
-    name: SimpleDataSet
-    data_dir: ./train_data/icdar2015/text_localization/
-    label_file_list:
-      - ./train_data/icdar2015/text_localization/test_icdar2015_label.txt
-    transforms:
-    - DecodeImage:
-        img_mode: BGR
-        channel_first: false
-    - DetLabelEncode: null
-    - DetResizeForTest:
-    - 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
-    num_workers: 2
-profiler_options: null

+ 0 - 0
paddlex/repo_apis/PaddleOCR_api/configs/RepSVTR_mobile_rec.yaml → paddlex/repo_apis/PaddleOCR_api/configs/ch_RepSVTR_rec.yaml


+ 0 - 0
paddlex/repo_apis/PaddleOCR_api/configs/SVTRv2_server_rec.yaml → paddlex/repo_apis/PaddleOCR_api/configs/ch_SVTRv2_rec.yaml


+ 0 - 7
paddlex/repo_apis/PaddleOCR_api/text_det/register.py

@@ -45,10 +45,3 @@ register_model_info({
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-OCRv4_server_det.yaml'),
     'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
-
-register_model_info({
-    'model_name': 'RepSVTR_mobile_det',
-    'suite': 'TextDet',
-    'config_path': osp.join(PDX_CONFIG_DIR, 'RepSVTR_mobile_det.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export']
-})

+ 4 - 4
paddlex/repo_apis/PaddleOCR_api/text_rec/register.py

@@ -46,16 +46,16 @@ register_model_info({
 })
 
 register_model_info({
-    'model_name': 'SVTRv2_server_rec',
+    'model_name': 'ch_SVTRv2_rec',
     'suite': 'TextRec',
-    'config_path': osp.join(PDX_CONFIG_DIR, 'SVTRv2_server_rec.yaml'),
+    'config_path': osp.join(PDX_CONFIG_DIR, 'ch_SVTRv2_rec.yaml'),
     'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
 })
 
 register_model_info({
-    'model_name': 'RepSVTR_mobile_rec',
+    'model_name': 'ch_RepSVTR_rec',
     'suite': 'TextRec',
-    'config_path': osp.join(PDX_CONFIG_DIR, 'RepSVTR_mobile_rec.yaml'),
+    'config_path': osp.join(PDX_CONFIG_DIR, 'ch_RepSVTR_rec.yaml'),
     'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
 })