2
$\begingroup$

I am working on a project that requires me to identify a product on a grocery shelf. For that, I am trying to use test recognition and localization to spot a product.

I tried Easy OCR and tesseract OCR because they are giving me accurate results, but it takes a lot of time to process the image

  1. Easy OCR takes about 7 seconds to process one image.
  2. Keras OCR takes about 42 seconds.

I followed this post to implement the code: https://www.kaggle.com/code/odins0n/keras-ocr-vs-easyocr-vs-pytesseract

I am running this on my laptop with NVIDIA GeForce RTX 3050 GPU. Is this expected behavior? Is there any way to improve the speed?

$\endgroup$

2 Answers 2

1
$\begingroup$

I think currently you are using CPU for detection and Recognition try installing the cuda to use GPU

pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117

This will improve speed by around 10X.

If you further want to increase the speed of the detection and recognition then:

Try using https://github.com/NVIDIA-AI-IOT/scene-text-recognition

It will further increase the speed of detection by 2X and for recognition by 5X.

$\endgroup$
1
  • $\begingroup$ Great! I voted for you $\endgroup$ Dec 5, 2023 at 4:53
0
$\begingroup$

EasyOCR should not be that slow using a GPU, have you installed the CPU version of PyTorch?

If you have a CPU version of PyTorch in the local cache you will need to do the following

uninstall the CPU version of pytorch

pip uninstall torch<br>

install the GPU version, don't use the local cache

pip install torch --extra-index-url https://download.pytorch.org/whl/cu116 --no-cache-dir<br>

If you do a "pip list", you should see, which are the GPU versions

torch                          1.13.1+cu116<br>
torchaudio                     0.13.1+cu116<br>
torchvision                    0.14.1+cu116<br>

I hope this helps.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .