How to converting tflite model output float aray to text- Text Recognition

I am working on a text recognition app from images.for that i am using a ‘tflite’ model(lite-model_east-text-detector_dr_1.tflite). After processing the input image I got a Tensor buffer that contains a float array.
How can I convert this output float array to text?
Is there any better ‘tflite’ model for text recognition from images?

Hi @Nison_Sunny ,

This float array indicates the position of inputs in a text file. Check the project you have for .txt file. Inside there you will see an input for every position.

Check this project at specific line


Hi @George_Soloupis
am using the below-added model for Text Recognition

I can’t find a text file with this model. Actually, I am looking for a text file that can map the output array, Similar to your Keras-ocr project

CTCDecoder is removed from these models so i think you also need to run decoder on your model output and then you will get text positions

How can i add a CTC decode in android app.
Could you please help?

According to this issue CTC tensorflow lite conversion problem · Issue #33494 · tensorflow/tensorflow · GitHub CTC is supported in TF2.4.
So maybe these models are already updated. What is the output shape from the model?

Hi @Kzyh
I think float32[1,26,37] is the output shape of the ‘tflite’ file that I used.
The tflite model that I have used is added below.

It seems there is no decoder. Did you try this one? TensorFlow Hub

@Kzyh Yes. I tried the keras-ocr. It’s working fine for me. But I think that model is only trained for a single word only. My Requirement is similar to reading data from Images like Bills, Cards, etc.

craft mode This is a tfmodel similar to my requirement. But i cant decode the output to text

Yeah. Seems like you need to detect text first, then run OCR on the detections. I dont think there is single model on tfhub to do all that at once.
You colud use craft-text-detector, cut out detected text boxes and feed them to keras-ocr.

1 Like