I am trying to test out Easy OCR. Now when I run my code
JavaScript
x
5
1
path = "{image file}"
2
read = easyocr.Reader(['en'], gpu=True)
3
result = read.readtext(path)
4
print(result)
5
It outputs this
JavaScript
1
6
1
[([[887, 1], [975, 1], [975, 13], [887, 13]], 'Photoshop PSD hle', 0.7655935865739645),
2
([[978, 2], [1022, 2], [1022, 10], [978, 10]], 'Jownioao', 0.2720053768871571),
3
([[1044, 2], [1152, 2], [1152, 10], [1044, 10]], 'Resolution 1230x1024P}', 0.3419384126594147),
4
([[1169, 2], [1274, 2], [1274, 10], [1169, 10]], 'uDsooradhics cor', 0.10438481226211914),
5
([[285, 474], [980, 474], [980, 716], [285, 716]], 'TEXT', 0.999515175819397)]
6
Instead of just
JavaScript
1
2
1
([[285, 474], [980, 474], [980, 716], [285, 716]], 'TEXT', 0.999515175819397)]
2
I want to get an simple output but it seems it also prints the image details and such.
EDIT: Sorry I posted a wrong output. If anyone is wondering here’s the link of the photo
Advertisement
Answer
As it is explained in the repo: “The output will be in a list format, each item represents a bounding box, the text detected and confident level, respectively.”
You can set detail=0
for simpler output:
JavaScript
1
2
1
result = read.readtext(path, detail = 0)
2