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
10 changes: 6 additions & 4 deletions PPOCRLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def get_str(str_id):
"use_textline_orientation": False,
"device": self.gpu,
"lang": self.lang,
"text_detection_model_name": "PP-OCRv5_server_det",
"text_recognition_model_name": "PP-OCRv5_server_rec",
"text_detection_model_name": "PP-OCRv5_mobile_det",
"text_recognition_model_name": "PP-OCRv5_mobile_rec",
"enable_mkldnn": False,
}

Expand All @@ -211,12 +211,12 @@ def get_str(str_id):

self.ocr = PaddleOCR(**params)
self.text_recognizer = TextRecognition(
model_name="PP-OCRv5_server_rec",
model_name="PP-OCRv5_mobile_rec",
model_dir=rec_model_dir,
device=self.gpu,
)
self.text_detector = TextDetection(
model_name="PP-OCRv5_server_det",
model_name="PP-OCRv5_mobile_det",
model_dir=det_model_dir,
device=self.gpu,
)
Expand Down Expand Up @@ -3392,6 +3392,8 @@ def modelChoose(self):
use_doc_orientation_classify=False,
use_textline_orientation=False,
use_doc_unwarping=False,
text_detection_model_name="PP-OCRv5_mobile_det",
text_recognition_model_name="PP-OCRv5_mobile_rec",
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

The model names are now hardcoded in multiple places (lines 200, 201, 214, 219, 3395, 3396). Consider defining these as constants at the module level to avoid duplication and make future model updates easier.

Suggested change
text_recognition_model_name="PP-OCRv5_mobile_rec",
text_detection_model_name=TEXT_DETECTION_MODEL_NAME,
text_recognition_model_name=TEXT_RECOGNITION_MODEL_NAME,

Copilot uses AI. Check for mistakes.
lang=choose_lang,
device=self.gpu,
)
Expand Down