d4-item-tooltip-ocr icon indicating copy to clipboard operation
d4-item-tooltip-ocr copied to clipboard

Awesome, but slow

Open Seminko opened this issue 2 years ago • 2 comments
trafficstars

Script works great. I can imagine non-ingame related use-cases, ie writing articles, discord bot etc.

Unfortunately it's quite slow which renders it unusable for non-bot ingame purposes, ie checking if gear has desired affixes when playing "manually".

Tested it briefly and got: 7.3s with find-tooltip True 16.75s with find-tooltip False

Nice work either way.

Seminko avatar Jul 13 '23 10:07 Seminko

I've updated the code in the repository to use MKLDNN if you are running on the CPU. With it enabled, I get OCR times between 0.3-0.5 seconds and a total processing time of 0.6-0.8 seconds on an AMD Ryzen 9 3900X (on 1080p screenshots).

Ideally, you would want to run PaddleOCR on the GPU. On a GeForce RTX 3070, I achieve OCR times around 0.1 seconds and a total processing time of 0.4 seconds (on 1080p screenshots). When using the GPU, there will be a warmup of a few seconds on the first image processed.

You need to install the correct version of PaddlePaddle depending on your environment. Please refer to this link: https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/en/install/pip/windows-pip_en.html#old-version-anchor-3-INSTALLATION

I have used the versions below.

CPU
pip install paddlepaddle==2.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

GPU/CUDA 10.2
pip install paddlepaddle-gpu==2.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

GPU/CUDA 11.7
pip install paddlepaddle-gpu==2.5.0 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html

mxtsdev avatar Jul 18 '23 09:07 mxtsdev

0.1s is impressive indeed! Unfortunately, my PC is not that decked out. Once I have a bit more time I will test the new code.

Seminko avatar Jul 18 '23 18:07 Seminko