JaidedAI / EasyOCR

Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.
https://www.jaided.ai
Apache License 2.0
23.96k stars 3.13k forks source link

how to utilize multicore with easyOCR? #1082

Open Hans-han opened 1 year ago

Hans-han commented 1 year ago

After its update to support Apple Silicon. But the performance improvement is not that strong.

I tried to use ProcessPoolExecutor to utilize multi-core on Mac but the attempt failed.

The error message was concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

I have 16GB ram which I think is enough. I don't know if it's the issue that Reader can't be initiated in another process.

Can someone give some help? Much Appreciated.

Hans-han commented 1 year ago

side notes. It is actually faster with CPU on M1 chip than GPU enabled. The reason? I guess because torch use multi-cpu threads automatically. Could be wrong didn't dig into the Torch and easyocr code.

ArtanisTheOne commented 1 year ago

side notes. It is actually faster with CPU on M1 chip than GPU enabled. The reason? I guess because torch use multi-cpu threads automatically. Could be wrong didn't dig into the Torch and easyocr code.

GPU has higher latency but better throughput, CPU has lower latency but worse throughput.