Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions PPOCRLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3375,14 +3375,26 @@ def modelChoose(self):
choose_lang = lg_idx[current_text]
if hasattr(self, "ocr"):
del self.ocr
self.ocr = PaddleOCR(
use_pdserving=False,
use_angle_cls=True,
det=True,
cls=True,
use_gpu=self.gpu,
lang=choose_lang,
)
# TODO the model will be automatically selected based on the language.
if choose_lang in ["french", "german", "korean"]:
self.ocr = PaddleOCR(
use_doc_orientation_classify=False,
use_textline_orientation=False,
use_doc_unwarping=False,
lang=choose_lang,
device=self.gpu,
ocr_version="PP-OCRv3",
enable_mkldnn=False, # The future will remove
)
else:
self.ocr = PaddleOCR(
use_doc_orientation_classify=False,
use_textline_orientation=False,
use_doc_unwarping=False,
lang=choose_lang,
device=self.gpu,
enable_mkldnn=False, # The future will remove
)
if choose_lang in ["ch", "en"]:
if hasattr(self, "table_ocr"):
del self.table_ocr
Expand All @@ -3395,6 +3407,7 @@ def modelChoose(self):
use_chart_recognition=False,
use_region_detection=False,
device=self.gpu,
enable_mkldnn=False, # The future will remove
)
else:
logger.error("Invalid language selection")
Expand Down