Commit 8f0cc148 authored by myhloli's avatar myhloli
Browse files

refactor: update OCR model configurations to use v5 and enhance language handling

parent 4eaa85fd
...@@ -57,7 +57,7 @@ class PytorchPaddleOCR(TextSystem): ...@@ -57,7 +57,7 @@ class PytorchPaddleOCR(TextSystem):
self.lang = kwargs.get('lang', 'ch') self.lang = kwargs.get('lang', 'ch')
device = get_device() device = get_device()
if device == 'cpu' and self.lang in ['ch', 'ch_server']: if device == 'cpu' and self.lang in ['ch', 'ch_server', 'japan', 'chinese_cht']:
logger.warning("The current device in use is CPU. To ensure the speed of parsing, the language is automatically switched to ch_lite.") logger.warning("The current device in use is CPU. To ensure the speed of parsing, the language is automatically switched to ch_lite.")
self.lang = 'ch_lite' self.lang = 'ch_lite'
......
...@@ -120,6 +120,22 @@ ch_PP-OCRv5_det_infer: ...@@ -120,6 +120,22 @@ ch_PP-OCRv5_det_infer:
name: DBHead name: DBHead
k: 50 k: 50
ch_PP-OCRv5_det_server_infer:
model_type: det
algorithm: DB
Transform: null
Backbone:
name: PPHGNetV2_B4
det: True
Neck:
name: LKPAN
out_channels: 256
intracl: True
Head:
name: PFHeadLocal
k: 50
mode: "large"
ch_PP-OCRv4_det_server_infer: ch_PP-OCRv4_det_server_infer:
model_type: det model_type: det
algorithm: DB algorithm: DB
......
lang: lang:
ch_lite: ch_lite:
det: ch_PP-OCRv3_det_infer.pth det: ch_PP-OCRv5_det_infer.pth
rec: ch_PP-OCRv5_rec_infer.pth rec: ch_PP-OCRv5_rec_infer.pth
dict: ppocrv5_dict.txt dict: ppocrv5_dict.txt
ch_lite_v4: ch_lite_v4:
det: ch_PP-OCRv3_det_infer.pth det: ch_PP-OCRv5_det_infer.pth
rec: ch_PP-OCRv4_rec_infer.pth rec: ch_PP-OCRv4_rec_infer.pth
dict: ppocr_keys_v1.txt dict: ppocr_keys_v1.txt
ch_server: ch_server:
det: ch_PP-OCRv3_det_infer.pth det: ch_PP-OCRv5_det_infer.pth
rec: ch_PP-OCRv5_rec_server_infer.pth rec: ch_PP-OCRv5_rec_server_infer.pth
dict: ppocrv5_dict.txt dict: ppocrv5_dict.txt
ch_server_v4: ch_server_v4:
det: ch_PP-OCRv3_det_infer.pth det: ch_PP-OCRv5_det_infer.pth
rec: ch_PP-OCRv4_rec_server_infer.pth rec: ch_PP-OCRv4_rec_server_infer.pth
dict: ppocr_keys_v1.txt dict: ppocr_keys_v1.txt
ch: ch:
det: ch_PP-OCRv3_det_infer.pth det: ch_PP-OCRv5_det_infer.pth
rec: ch_PP-OCRv4_rec_server_doc_infer.pth rec: ch_PP-OCRv4_rec_server_doc_infer.pth
dict: ppocrv4_doc_dict.txt dict: ppocrv4_doc_dict.txt
en: en:
...@@ -28,12 +28,12 @@ lang: ...@@ -28,12 +28,12 @@ lang:
rec: korean_PP-OCRv3_rec_infer.pth rec: korean_PP-OCRv3_rec_infer.pth
dict: korean_dict.txt dict: korean_dict.txt
japan: japan:
det: Multilingual_PP-OCRv3_det_infer.pth det: ch_PP-OCRv5_det_infer.pth
rec: japan_PP-OCRv3_rec_infer.pth rec: ch_PP-OCRv5_rec_server_infer.pth
dict: japan_dict.txt dict: japan_dict.txt
chinese_cht: chinese_cht:
det: Multilingual_PP-OCRv3_det_infer.pth det: ch_PP-OCRv5_det_infer.pth
rec: chinese_cht_PP-OCRv3_rec_infer.pth rec: ch_PP-OCRv5_rec_server_infer.pth
dict: chinese_cht_dict.txt dict: chinese_cht_dict.txt
ta: ta:
det: Multilingual_PP-OCRv3_det_infer.pth det: Multilingual_PP-OCRv3_det_infer.pth
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment