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

fix(EasyOcrModel): Control if the EasyOcrModel will run on GPU based on the pipeline options and the presence of MPS #282

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

nikos-livathinos
Copy link
Collaborator

  • Implement support for the EasyOcrOptions.use_gpu parameter.
  • Disable the GPU for EasyOCR if MPS is detected.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the
    conventional commits.
  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

…odel. Initialize easyocr

without GPU if MPS is available.

Signed-off-by: Nikos Livathinos <nli@zurich.ibm.com>
Copy link
Contributor

@PeterStaar-IBM PeterStaar-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

Copy link

@bbrowning bbrowning left a comment

Choose a reason for hiding this comment

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

This logic looks reasonable to me - both the auto-disabling of GPU when running in a Torch with MPS enabled, and the wiring of the use_gpu parameter up to actually control the GPU usage of the easyocr.Reader. Thanks for the quick fix, and for making it as easy as possible for us downstream users to get the right Mac behavior out of the box!

@nikos-livathinos nikos-livathinos merged commit 0eb065e into main Nov 8, 2024
7 checks passed
@nikos-livathinos nikos-livathinos deleted the fix_easyocr_init branch November 8, 2024 15:48
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.

3 participants