EDAS
EDAS

Reputation: 21

Tensorflow Lite Object Detection with Custom AutoML Model

I like to test the Object Detection Example of TFLite.

https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/android

The example with the default Model works great. But I want to test a custom Model generated from AutoML. When I am replace the "detect.tflite" and "labelmap fille" in the "\src\main\assets" directory and build then the App crashes after launch.

My Model is very simple ... can detect only 2 objects (Tiger and Lion). And my labelmap file contains below:

??? Tiger Lion

Also I comment the line "//apply from:'download_model.gradle'" in "build.gradle" to stop the download of default Model and use my custom Model from asset.

I new in both Android and this ML space. I'll be glad if anyone can advise for App crash after launch with custom AutoML Model.

Thanks in advance.

Regards.

Upvotes: 0

Views: 806

Answers (1)

David
David

Reputation: 11

Two probable errors on log might be:

Cannot convert between a TensorFlowLite buffer with 1080000 bytes and a ByteBuffer with 270000 bytes. Modify TF_OD_API_INPUT_SIZE accordingly.

tflite ml google [1, 20, 4] and a Java object with shape [1, 10, 4]. Modify NUM_DETECTIONS according to custom model.

Upvotes: 0

Related Questions