kotlindl icon indicating copy to clipboard operation
kotlindl copied to clipboard

[FeatureRequest] Add EAST text detection support

Open rcd27 opened this issue 3 years ago • 5 comments

There is very usefull pretrained Tensorflow model for detecting text on image: https://github.com/argman/EAST

Would be nice to use that in KotlinDL

Opencv.DNN module has such a support: python tutorial OpenCV doc reference I've also ported it to Kotlin, works fine (a lot of boilerplate, but OK)

rcd27 avatar Feb 07 '22 16:02 rcd27

This is a Kotlin implementation with use of OpenCV.DNN module + EAST detection model: https://github.com/rcd27/opencv-EAST-kotlin

rcd27 avatar Feb 10 '22 08:02 rcd27

It's an interesting proposal. A have a few questions before we move forward. Is the model saved to .pb format generated by Tensorflow version 1.x? Looks like yes, but we should now. If yes, I suggest implementing an example using, ONNX module for example or Tensorflow Saved Module + Image DSL preprocessing.

The best way to convert to ONNX via https://github.com/onnx/tensorflow-onnx project in Colab, for example.

If you need some help on all steps, please let me know

zaleslaw avatar Feb 14 '22 11:02 zaleslaw

Yes, the model format is .pb, I'll try to go through the steps you suggested.

rcd27 avatar Feb 21 '22 05:02 rcd27

@zaleslaw all EAST models with .pb format I found in the internet were missing tag value (checked with saved_model_cli tool). That makes tensorflow-onnx to throw error (missing tag) while trying to convert to ONNX format. Any ideas how to workaround this?

rcd27 avatar Feb 22 '22 16:02 rcd27

Looks like it requires a tag setting before convertation I found a few contants here https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/tag_constants.py#L27

zaleslaw avatar Feb 25 '22 09:02 zaleslaw