faustomorales / keras-ocr

A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model.
https://keras-ocr.readthedocs.io/
MIT License
1.39k stars 360 forks source link

Get prediction confidence percentage #177

Open tommasoVilla opened 3 years ago

tommasoVilla commented 3 years ago

Hi Fausto! First of all, congratulation for your job and thank you for sharing it with us!

I'm interested in getting a confidence percentage for the recognizer's predictions. I found out the method tf.keras.backend.ctc_decode (used in row 175 of keras_ocr/recognition.py) can return a logarithmic probability representing the guess confidence level. I would access the element in position 1 of the returning value of ctc_decode but I can't understand the shape of that and the correct way to get it. Once getting this, I have to return this probability together with the real prediction in row 182. At the end, i should change the rows 532-542 in order to make this probability accessible after the invocation of recognize_from_boxes; in this case also i can't figure out what I'm supposed to do.

Have you ever thought about this feature? Can you help me to extend your work in order to accomplish my task?

I'll wait for you news, thank you in advance!

bilalltf commented 2 years ago

Hey @tommasoVilla, any solution?

ecastroth commented 1 year ago

Hey @bilalltf @tommasoVilla, any solution?

davesteps commented 1 year ago

Hey @ecastroth @bilalltf @tommasoVilla, any solution?