Keras Ocr TFlite

5 views
Skip to first unread message

George Soloupis

unread,
Dec 11, 2020, 12:01:01 AM12/11/20
to Sayak Paul, TULASI RAM LAGHUMAVARAPU, Khanh LeViet, ML on Mobile OS Working Group
Hi everyone,

Getting in touch with Tulasi's wonderful notes I came across a function that is mandatory for OCR inference. It is  tf.keras.backend.ctc_decode...
We are talking about a decoder that generates words from character probabilities (if I am correct). I found some info here but it seems strange to work inside android code. I have worked last year with Mozilla's STT implementation that had a CTC decoder inside. 
I will take a look (C++ code) and search on the internet what we can do about that.

If you can find info to overcome this problem please provide.

Regards,
George

Sayak Paul

unread,
Dec 11, 2020, 12:04:59 AM12/11/20
to George Soloupis, TULASI RAM LAGHUMAVARAPU, Khanh LeViet, ML on Mobile OS Working Group
Yeah, the TensorFlow Lite model excludes the CTC Decoder since it currently does not support it. 

@TULASI RAM LAGHUMAVARAPU worked on a CPP implementation if I remember correctly. 
Sayak Paul | sayak.dev


TULASI RAM LAGHUMAVARAPU

unread,
Dec 11, 2020, 12:26:51 AM12/11/20
to Sayak Paul, George Soloupis, Khanh LeViet, ML on Mobile OS Working Group
Yes George, I already worked on that Cpp implementation before although I don't have code as it was working for my company. But implementing greedy CTC decoder is straight forward. We will first add greedy decoder as default one and then we will implement beam search CTC decoder. Let us discuss more on this in the Saturday meeting.

George Soloupis

unread,
Dec 11, 2020, 12:29:17 AM12/11/20
to TULASI RAM LAGHUMAVARAPU, Sayak Paul, Khanh LeViet, ML on Mobile OS Working Group
Ok
Sounds good!

George Soloupis

unread,
Dec 11, 2020, 3:01:35 AM12/11/20
to Hoi Lam, Khanh LeViet, ML on Mobile OS Working Group, Sayak Paul, TULASI RAM LAGHUMAVARAPU
Hey Hoi,

Along with Sayak and Tulasi we are building an android application that uses Keras OCR. Getting in touch with the code I discovered that there is a part of code that uses a ctc decoder. Please find more info at the forwarded message below. 

I want to ask how do you apply ctc decoding at ML kit here

Regards,
George
Reply all
Reply to author
Forward
0 new messages