Spawn multiple _ocrProcess process and do all the OCR job there
Caveats:
pytorch is not thread-safe, so use of multiprocessing module is necessary
OCR processes are NOT gracefully terminated. I don't know when to terminate them.
New options:
--easyocr-workers [number]: # of OCR processes. VRAM usage increases proportionally. IDK if this could be reduced, as EasyOCR doesn't seem to be multiprocessing-safe
--easyocr-batch-size [number]: Set batch_size parameter of easyocr. Don't expect a lot of performance gain, though.
Before (See GPU usage)
After (See GPU usage)
not a fair comparison: Old implementation wants to use 12GB of ram, so it doesn't fit in my 3060. New implementation allows you to configure the amount of ram you want.
I'm seeing a speedup of 4x, but this may vary for people with lots of VRAMs. Further testing needed.
Spawn multiple
_ocrProcess
process and do all the OCR job thereCaveats:
multiprocessing
module is necessaryNew options:
--easyocr-workers [number]
: # of OCR processes. VRAM usage increases proportionally. IDK if this could be reduced, asEasyOCR
doesn't seem to be multiprocessing-safe--easyocr-batch-size [number]
: Setbatch_size
parameter of easyocr. Don't expect a lot of performance gain, though.Before (See GPU usage)
After (See GPU usage)
I'm seeing a speedup of 4x, but this may vary for people with lots of VRAMs. Further testing needed.
Fixes #3