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

Perform OCR multiple images at the same time? #394

Closed
harsh-miv opened this issue Mar 13, 2021 · 7 comments
Closed

Perform OCR multiple images at the same time? #394

harsh-miv opened this issue Mar 13, 2021 · 7 comments

Comments

@harsh-miv
Copy link

harsh-miv commented Mar 13, 2021

I am using easyocr on a GPU, but the overall time taken for my dataset is large and my GPU are not being fully utilized, is there a way to group together images and using GPU to its max extent?

@rkcosmos
Copy link
Contributor

rkcosmos commented Mar 23, 2021

try adjusting batch_size argument (see documentation )

@alexander-soare
Copy link
Contributor

alexander-soare commented Apr 16, 2021

@rkcosmos thanks for picking up on this. It's not clear to me how to pass in a batch of images corresponding to batch_size. I have tried with a list bit I get the misleading NameError: name 'LOGGER' is not defined error.

@sangeethkumar1997
Copy link

@rkcosmos result_batch = reader.readtext(i,detail = 0,batch_size=64)

i is of shape (64, 256, 256, 3) , But it is expecting np array of len(img.shape) less than or equal to 3.

UnboundLocalError: local variable 'img' referenced before assignment

@rkcosmos
Copy link
Contributor

Input image has to be one image (not array of images). This batch_size means EasyOCR will create batch of several text boxes to be recognized at the same time internally. Batch of several input images is not supported.

@SamSamhuns
Copy link
Contributor

I did create some edits on the scripts to load a batch of input images for the detector as well (inference speed should go up in GPU mode). If there is enough interest, I can create a PR for this

@sangeethkumar1997
Copy link

@SamSamhuns That would be great!

@SamSamhuns
Copy link
Contributor

#458 PR has been created for the batched image inference for text detection as well, @rkcosmos please have a look

@rkcosmos rkcosmos closed this as completed Mar 2, 2022
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

5 participants