Skip to content

Conversation

@zahin178
Copy link
Contributor

PR Type

Refactor

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made.
  • Version number has been updated.
  • Required modules have been added to respective "requirements*.txt" files.
  • Relevant Test Cases added to this description (below).
  • (Team) Label with affected action categories and semver status.

Overview

Removed the easyocr from the following files

  1. requirements-linux.txt
  2. requirements-mac.txt
  3. requirements-win.txt

Removed from turtle import right

Added the install_easyocr() function that does the following

  1. Checks which OS is being used.
  2. If it's Windows then it will run one set of instructions and for Linux/Mac it will run another set of instructions.
  3. It will check if easyocr has been installed or not.
  4. If not it will install the easyocr automatically.
  5. Previously used the following command for installation
    os.system('echo y | pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org easyocr')
  6. Now using the following code
result = subprocess.run(
                    ['pip3', 'install', '--trusted-host', 'pypi.org', '--trusted-host', 'files.pythonhosted.org', 'easyocr'],
                    check=True,
                    text=True,
                    capture_output=True
                )

Here is the output in Windows

  1. If easyocr already exists
    easyocr_already_installed
  2. If easyocr does not exist
    easyocr_install

Could not check for Linux as it takes a lot of time to install supplement modules

Test Cases

@sazid sazid merged commit 7f0347a into dev May 28, 2024
@sazid sazid deleted the ocr_actions branch May 28, 2024 10: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