A tensorflow lite model to detect if an object is a book or not a book

81 views
Skip to first unread message

Poorya Piroozan

unread,
Mar 16, 2021, 2:53:44 PM3/16/21
to TensorFlow Lite
Hi everyone

I'm very new to tensorflow so I hope my question is ok.

What I'm trying to do is to make a tensorflow application in Unity to detect whether an object is a book or not a book, and that's it.

I've used this unity implementation of tensorflow lite for unity: https://github.com/asus4/tf-lite-unity-sample

It uses files with .tflite extensions and detects many objects and the accuracy is not bad but it's super laggy.

I don't care about other objects. All I want is to know if it's a book or not. Maybe that'll help reduce the lag too. Since I'm new to Tenserflow, I have no idea where to start. Can someone please point me in the right direction?

Thanks a lot

Jaesung Chung

unread,
Mar 16, 2021, 5:22:18 PM3/16/21
to Poorya Piroozan, TensorFlow Lite
If you want to accelerate your model, you can consider the following options.

(1) Choosing a model with smaller weights or a smaller image size input. This helps to reduce the overall computations by selecting a smaller model.

(2) Utilizing model optimization techniques, for example, quantizations and sparsity. These techniques can reduce the footprint and improve overall performance in the latency. https://www.tensorflow.org/lite/performance/model_optimization

(3) Enabling the mobile hardware acceleration option on mobile, for example, GPU delegate or NNAPI delegate, which can save the model's computation time by using the special hardware's capability. https://www.tensorflow.org/lite/performance/delegates

--
You received this message because you are subscribed to the Google Groups "TensorFlow Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tflite+un...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tflite/b1a6ca05-21a9-4b38-98eb-be956f647585n%40tensorflow.org.

Jared Duke

unread,
Mar 16, 2021, 6:01:16 PM3/16/21
to Jaesung Chung, Poorya Piroozan, TensorFlow Lite
Beyond Jaesung's suggestions, you might also consider filing an issue against https://github.com/asus4/tf-lite-unity-sample. It's possible there are some performance interop issues or bottlenecks that deserve closer attention C# bindings and sample code. Feel free to loop me in to that discussion as follow-up to help with further diagnosis.

Note also that TensorFlow Lite is primarily optimized for mobile devices, so if you're just comparing raw performance in the Unity editor between TF and TFLite, that could account for some of the perceived difference.

Poorya Piroozan

unread,
Mar 17, 2021, 12:03:28 PM3/17/21
to TensorFlow Lite, Jared Duke, Poorya Piroozan, TensorFlow Lite, Jaesung Chung
Thank you Jared.
but didn't know how to add you to the discussion about it?
Reply all
Reply to author
Forward
0 new messages