Skip to content

Print out alternate predicted results string and probabilities #1019

@rdavis22

Description

@rdavis22

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions