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

Understanding speed of Tesserocr's image_to_text #269

Open
parulsingh23 opened this issue Aug 26, 2021 · 1 comment
Open

Understanding speed of Tesserocr's image_to_text #269

parulsingh23 opened this issue Aug 26, 2021 · 1 comment

Comments

@parulsingh23
Copy link

The ReadMe file states that:

image_to_text can be used with threading to concurrently process multiple images which is highly efficient.

However, I'm curious as to how much faster this is. For example, if I were to run tesseract on 120 images each around 100x30 pixels, the average time is .18 seconds per image.

How would running Tesserocr's image_to_text on 120 images each around 100x30 pixels (all in a thread) take?
Additionally, how would this time compare using a computer's CPU, versus a GPU (like provided on google collab, or AWS EC2 instances)?

@ichenjia
Copy link

You shouldn't use image_to_text if you have multiple images. Load model and establish the API takes time. You are better off doing something like this:

tess_api=tesserocr.PyTessBaseAPI()

for img in imgs:
  tess_api.SetImage(img)
  text = tess_api.GetUTF8Text()

tess_api.End()

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

No branches or pull requests

2 participants