Skip to content
Merged
Changes from 4 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
27 changes: 19 additions & 8 deletions PPOCRLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3375,14 +3375,24 @@ 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=True,
Copy link
Collaborator

@GreatV GreatV Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最好把这两个参数设置为false, doc unwarping后的图和原图文字位置会有变化。下面的分支建议也改一下。

use_doc_unwarping=False,
use_doc_orientation_classify=False,

use_textline_orientation=True,
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=True,
use_textline_orientation=True,
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 +3405,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