EasyOCR icon indicating copy to clipboard operation
EasyOCR copied to clipboard

Print out alternate predicted results string and probabilities

Open rdavis22 opened this issue 2 years ago • 2 comments

Hi,

Is there a method to print out the alternate results from the "Reader" class? For instance, here is an example of my code:

###Example code### reader = easyocr.Reader(['en'], gpu = True) results = reader.readtext('example_labeltif')

for result in results: bbox, text, score = result print(f"Text: {text}") print(f"Confidence Score: {score}") print()

(Returns):

Text: 5023-00013 A-3 Confidence Score: 0.7890631529022496

Text: BEAKER, Confidence Score: 0.9955028038505163

Text: ERIKA Confidence Score: 0.6211073188069697

I would like to see what the alternate predictions were for "5023-00013 A-3".

An example alternative predicition for "5023-00013 A-3" would be something like this (e.g. S823-88813 A-3", Confidence score: 0.200234)

Is there a way to do this? Possibly altering "recognition.py" "get_recoginizer" method? I don't want to alter any source code if I have to but if someone has a solution, I am all ears.

rdavis22 avatar May 16 '23 19:05 rdavis22

#784

cottrell avatar Oct 01 '24 11:10 cottrell

now see #1311

cottrell avatar Oct 02 '24 11:10 cottrell