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.36k stars 348 forks source link

[Android] Convert in TF-lite is possible? #120

Open NeighborhoodCoding opened 3 years ago

NeighborhoodCoding commented 3 years ago

I want to use this OCR in Android.

I considered this TF-lite github(this is yolov4, actually... https://github.com/hunglc007/tensorflow-yolov4-tflite

https://github.com/shaqian/flutter_realtime_detection)

And it seems that converted TF-lite is can be run on android(I also build TF-lite android app successfully).

I'm studying flutter pipeline and I understand a litte bit...but yolo is actually one TF. however... keras-ocr is actually 2 TF. (recognize, detect)

1) can i convert two TF-python(recognize, detet) to TF-lite? If possibble, the input and output is same as TF in python? ( I surveyed this, https://github.com/hunglc007/tensorflow-yolov4-tflite/blob/master/convert_tflite.py seems it converts TF to TFlite, converter = tf.lite.TFLiteConverter.from_saved_model(FLAGS.weights) or converter = tf.lite.TFLiteConverter.from_keras_model(model) )

is possible... All i have to do more is made flutter(or java, kotlin) pipelines instead of python pipeline. Am I right?

tulasiram58827 commented 3 years ago

Hey @SungmanHong I succesfully converted to TFLite especially for android developers. You can find the TFLite models in this Repository. Feel free to create a issue if you have any doubts in the repo itself.