Skip to content

Commit 56aeabb

Browse files
authored
[Update] remove enable_mkldnn = False and choose lang (#185)
* remove enable_mkldnn = False and choose lang * modify pyproject.toml
1 parent ae4828a commit 56aeabb

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

PPOCRLabel.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,11 @@ def get_str(str_id):
214214
model_name="PP-OCRv5_server_rec",
215215
model_dir=rec_model_dir,
216216
device=self.gpu,
217-
enable_mkldnn=False,
218217
)
219218
self.text_detector = TextDetection(
220219
model_name="PP-OCRv5_server_det",
221220
model_dir=det_model_dir,
222221
device=self.gpu,
223-
enable_mkldnn=False,
224222
)
225223
self.table_ocr = PPStructureV3(
226224
use_doc_orientation_classify=False,
@@ -231,7 +229,6 @@ def get_str(str_id):
231229
use_chart_recognition=False,
232230
use_region_detection=False,
233231
device=self.gpu,
234-
enable_mkldnn=False,
235232
)
236233

237234
if os.path.exists("./data/paddle.png"):
@@ -3389,25 +3386,12 @@ def modelChoose(self):
33893386
choose_lang = lg_idx[current_text]
33903387
if hasattr(self, "ocr"):
33913388
del self.ocr
3392-
# TODO the model will be automatically selected based on the language.
3393-
if choose_lang in ["french", "german", "korean"]:
33943389
self.ocr = PaddleOCR(
33953390
use_doc_orientation_classify=False,
33963391
use_textline_orientation=False,
33973392
use_doc_unwarping=False,
33983393
lang=choose_lang,
33993394
device=self.gpu,
3400-
ocr_version="PP-OCRv3",
3401-
enable_mkldnn=False, # The future will remove
3402-
)
3403-
else:
3404-
self.ocr = PaddleOCR(
3405-
use_doc_orientation_classify=False,
3406-
use_textline_orientation=False,
3407-
use_doc_unwarping=False,
3408-
lang=choose_lang,
3409-
device=self.gpu,
3410-
enable_mkldnn=False, # The future will remove
34113395
)
34123396
if choose_lang in ["ch", "en"]:
34133397
if hasattr(self, "table_ocr"):
@@ -3421,7 +3405,6 @@ def modelChoose(self):
34213405
use_chart_recognition=False,
34223406
use_region_detection=False,
34233407
device=self.gpu,
3424-
enable_mkldnn=False, # The future will remove
34253408
)
34263409
else:
34273410
logger.error("Invalid language selection")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "PPOCRLabel"
77
dynamic = ["version"]
88
dependencies = [
99
"pyqt5",
10-
"paddleocr>=3.0",
10+
"paddleocr>=3.0.2",
1111
"openpyxl",
1212
"tqdm",
1313
"premailer",

0 commit comments

Comments
 (0)