[Update] Change OCR model names to mobile versions#210
Merged
GreatV merged 1 commit intoPFCCLab:mainfrom Aug 12, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the OCR model configuration to use mobile versions instead of server versions for improved performance. The change switches from PP-OCRv5_server_* models to PP-OCRv5_mobile_* models across multiple OCR initialization points.
Key Changes
- Replace PP-OCRv5_server_det with PP-OCRv5_mobile_det for text detection
- Replace PP-OCRv5_server_rec with PP-OCRv5_mobile_rec for text recognition
- Add explicit model name parameters to the modelChoose method
| use_textline_orientation=False, | ||
| use_doc_unwarping=False, | ||
| text_detection_model_name="PP-OCRv5_mobile_det", | ||
| text_recognition_model_name="PP-OCRv5_mobile_rec", |
There was a problem hiding this comment.
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.