Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ocr): expose rec_keys_path in RapidOcrOptions to support custom dictionaries #786

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

terwey
Copy link

@terwey terwey commented Jan 22, 2025

  • Added rec_keys_path to RapidOcrOptions to align with RapidOCR's capability to use custom character dictionaries.
  • Passed rec_keys_path to RapidOcrModel initialization, ensuring the recognition model can load the correct dictionary (e.g., for Latin characters).

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Copy link

mergify bot commented Jan 22, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@terwey terwey changed the title Expose rec_keys_path in RapidOcrOptions to support custom dictionaries feat(ocr): expose rec_keys_path in RapidOcrOptions to support custom dictionaries Jan 22, 2025
@dolfim-ibm
Copy link
Contributor

Thanks @terwey for your first contribution. Before we can approve and merge this, we require you to rebase your commit with a sign-off. See the the CONTRIBUTING.md guidelines.

In practice, these steps should do it.

To add your Signed-off-by line to every commit in this branch:

Ensure you have a local copy of your branch by checking out the pull request locally via command line.
In your local branch, run: git rebase HEAD~1 --signoff
Force push your changes to overwrite the branch: git push --force-with-lease origin rapidocr_rec_keys

@dolfim-ibm dolfim-ibm self-requested a review January 23, 2025 10:18
- Added `rec_keys_path` to `RapidOcrOptions` to align with RapidOCR's capability to use custom character dictionaries.
- Passed `rec_keys_path` to `RapidOcrModel` initialization, ensuring the recognition model can load the correct dictionary (e.g., for Latin characters).

Signed-off-by: Yorick Terweijden <[email protected]>
@terwey terwey force-pushed the rapidocr_rec_keys branch from 55c233e to d2f9f05 Compare January 23, 2025 13:35
Copy link
Contributor

@dolfim-ibm dolfim-ibm left a comment

Choose a reason for hiding this comment

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

lgtm

@dolfim-ibm
Copy link
Contributor

@terwey it looks like you pushed without running the pre-commit hooks which now are failing in tests. Can you please patch your PR?

For example running

poetry run pre-commit run --all-files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants