weinman / cnn_lstm_ctc_ocr

Tensorflow-based CNN+LSTM trained with CTC-loss for OCR
GNU General Public License v3.0
498 stars 170 forks source link

confidence on sess passing #67

Closed imohammadhossein closed 3 years ago

imohammadhossein commented 4 years ago

hey i am using the old versions of your code which at there you make a session, loading once on a server and inferencing it for several times, the problem is I can not get access to the confidence of the prediction; I am using your code which runs with sess.run not with tf.estimator, can you help me to solve this problem ?

weinman commented 4 years ago

I can't promise anything, but it would help everyone to know more precisely what tag or commit id your query is regarding.

imohammadhossein commented 4 years ago

yes, on tf-1.8, the tag is.

imohammadhossein commented 4 years ago

my next question is that can we have the confidence of each character of output. for example if the output resault is "art", can we have the confidence for each of "a", "r" and "t" ? thank you!

imohammadhossein commented 4 years ago

can any one please help me ??

weinman commented 3 years ago

Tag 1.8 is too old to provide any meaningful help (both because it's too old for me to remember, but also because it's deprecated). CTC collapses the characters, so you won't get the probabilities of the marginals each character corresponds to. The only thing you can get is the logits for the individual characters, because tf.nn.ctc_beam_search_decoder gives you the total probability of each of the top paths, rather than the constituent probabilities. You'd have to tear into the underlying C++ code to get and return those.

imohammadhossein commented 3 years ago

i got it thankyou so much.

On Fri, 18 Dec 2020 at 02:24, Jerod Weinman notifications@github.com wrote:

Closed #67 https://github.com/weinman/cnn_lstm_ctc_ocr/issues/67.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/weinman/cnn_lstm_ctc_ocr/issues/67#event-4127388475, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJZ4MM554NRCIRB2YOAGDH3SVKD3RANCNFSM4J7EHJPQ .

-- Respectfully, MohammadHosein NikiMaleki