python-scripts/scripts/Extract_TEXT_FROM_IMAGE/main.py

15 lines
313 B
Python
Raw Normal View History

2022-10-13 13:52:20 +00:00
import easyocr
gpu = False # if you want to use GPU, set gpu=True
languages = ['en'] # refer https://www.jaided.ai/easyocr/ for supporting languages
reader = easyocr.Reader(languages, gpu=gpu)
IMG_PATH = 'test1.png'
result = reader.readtext(IMG_PATH)
text = ''
for tup in result:
text += tup[1]
print(text)