mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-12-18 16:20:17 +00:00
15 lines
313 B
Python
15 lines
313 B
Python
|
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)
|