-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integrating (CTCWordBeamSearch)PureNumpy with (SimpleHTR --wordbeamsearch) #52
Comments
you have to evaluate the output of the RNN with softmax applied, and then feed this into the decoder. Something like that (not tested):
|
Step-1 Initialize above in init of Model.py Step-2 in Model.py--> setupCTC() defined Point-1 Above
Sidenote- I am running code as(python main.py --wordbeamsearch) (using presaved model ,testing on a single image) Modified model.py I have uploaded on my git just for time being after that i will remove , I have also given your reference while uploading model.py |
Thanks again for your earlier response sir |
Hi, at first sight code looks OK. I guess this line is wrong and can be removed (you want to pass all batch elements to the function decoderOutputToText and not just the one with index 0): If this does not fix the problem: can you upload all of your code into your repository? So that I just have to download it and run it to reprocude the error. |
Sir ,After your input I am able to somehow run it on "Word" , I am not quite confident in what patches i have made during the process is right or Its really worked , Beside it Sir may you please suggest into line segmentation(Breaking a page into lines ) approach ? (The approach you think would work best on IAM(Not quite complex scenario) with preferable code implementation link). Additionally I will upload the codes of the patches i try to work out , Kindly go through it sir once uploaded . Thanks again for your timely valuable feedbacks |
you can try WordDetectorNN to detect handwritten words on a scanned page. |
FYI: SimpleHTR is now using the Python package (numpy operation) instead of the TF operation. |
Thank you so much sir I was in the dire need of same ... Thanks again ..
Regards,
Vaibhav
…On Fri, Feb 19, 2021, 01:59 Harald Scheidl ***@***.***> wrote:
FYI: SimpleHTR is now using the Python package (numpy operation) instead
of the TF operation.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXE74G3P5LLSOWG4M76AKDS7V2D5ANCNFSM4XBA62RA>
.
|
Dear Sir,
Thank you for making it compatible along with windows , Your kind suggestion is required to implement it in SimpleHTR code --wordbeamsearch option--
Code snippet of SimpleHTR-->Model.py
##################################
word_beam_search_module = tf.load_op_library('TFWordBeamSearch.so')
chars = str().join(self.charList)
wordChars = open('../model/wordCharList.txt').read().splitlines()[0]
corpus = open('../data/corpus.txt').read()
decode using the "Words" mode of word beam search
self.decoder =word_beam_search_module.word_beam_search(tf.nn.softmax(self.ctcIn3dTBC, dim=2), 50, 'Words', 0.0, corpus.encode('utf8'), chars.encode('utf8'), wordChars.encode('utf8'))
#################################
What should I replace it with to integrate CTCWordBeamSearch with SimpleHTR
Note-
**Initially i have tried to replace it with WordBeamSearch() , got confused with what to feed
**at my second try I try to convert tf.nn.softmax(self.ctcIn3dTBC, dim=2) into np.array(tf.nn.softmax(self.ctcIn3dTBC, dim=2)) results an error
** called testPybind() with above parameters results in error ..,,
Please may guide to which direction go next
The text was updated successfully, but these errors were encountered: