浏览代码

feat(model): update Chinese OCR detection model to PP-OCRv3

- Replace ch_PP-OCRv4_det_infer.pth with ch_PP-OCRv3_det_infer.pth in models_config.yml
- Add new ch_PP-OCRv3_det_infer model configuration in arch_config.yaml
myhloli 7 月之前
父节点
当前提交
ddfeea9498

+ 17 - 0
magic_pdf/model/sub_modules/ocr/paddleocr2pytorch/pytorchocr/utils/resources/arch_config.yaml

@@ -45,6 +45,23 @@ en_PP-OCRv3_det_infer:
     name: DBHead
     k: 50
 
+ch_PP-OCRv3_det_infer:
+  model_type: det
+  algorithm: DB
+  Transform:
+  Backbone:
+    name: MobileNetV3
+    scale: 0.5
+    model_name: large
+    disable_se: True
+  Neck:
+    name: RSEFPN
+    out_channels: 96
+    shortcut: True
+  Head:
+    name: DBHead
+    k: 50
+
 en_PP-OCRv4_rec_infer:
   model_type: rec
   algorithm: SVTR_LCNet

+ 1 - 1
magic_pdf/model/sub_modules/ocr/paddleocr2pytorch/pytorchocr/utils/resources/models_config.yml

@@ -1,6 +1,6 @@
 lang:
   ch:
-    det: ch_PP-OCRv4_det_infer.pth
+    det: ch_PP-OCRv3_det_infer.pth
     rec: ch_PP-OCRv4_rec_infer.pth
     dict: ppocr_keys_v1.txt
   en: