Open robertknight opened 2 years ago
Since text recognition is the expensive step, a middle ground would be to do detection in one thread, then use multiple threads to perform recognition of different text lines that were found in parallel.
Rough plan for this:
loadModel
would load the model into all workers, or if recognition workers are created on-demand, save a copy of the model data for transfer to recognition workers when they are created subsequentlyloadImage
would load the image into the main worker
There are several ways that threads could be used to speed up recognition:
OCRClient
s and distribute images across them. This can already be done today, but won't help for single document images, and requires duplicating a lot of resources in each worker, so is not memory-efficient.OCRClient
s. This is possible today, but again results in a lot of resource duplication, and requires work to figure out how to split up the image.