For text detection I simply used clovaai CRAFT-pytorch repository. Although they also have their text recognition model but their offline model is not trained on alphanumerics. So I used pytesseract for text recognition.
-
Install tesseract from https://github.com/UB-Mannheim/tesseract/wiki
-
Tesseract-OCR directory will be created at the installation location.
-
Go to Tesseract-OCR\tessdata and replace eng.traineddata file with https://github.com/tesseract-ocr/tessdata_best/blob/master/eng.traineddata
-
Add Tesseract-OCR and tessdata directory paths to the Path variables.
Open command prompt in the image directory.
tesseract image_name.png out.
This will create out.txt with the detected text.
run demo.py:
python demo.py --imageDir="path/to/imageDir" --preprocess="thresh" --resize=Fasle