flutter_tflite icon indicating copy to clipboard operation
flutter_tflite copied to clipboard

use Tflite.detectObjectOnFrame in isolate

Open ghost opened this issue 4 years ago • 6 comments

We are using Tflite.detectObjectOnFrame for object detection on the camera imagestream but we get poor camera performance on older devices. So I was thinking of putting this in isolate.

Did anybody tried this already?

Any input is valuable.

thanks Steven

ghost avatar Sep 15 '20 13:09 ghost

Could I ask how you trained your object detection model and then converted it? I have tried but since my TF version is 2.3.0 I cant import it in Flutter.

zbejas avatar Sep 15 '20 13:09 zbejas

I used this colab to build my model: https://colab.research.google.com/drive/1qXn9q6m5ug7EWJsJov6mHaotHhCUY-wG?usp=sharing

and I used the rel time object detection example of tflite to experiment on it: https://github.com/shaqian/flutter_realtime_detection

ghost avatar Sep 15 '20 16:09 ghost

Here is my approach. Lets say compromise solution.

https://medium.com/@vad.pinchuk/image-stream-processing-in-flutter-application-by-tflite-neural-networks-2c40d65f3b67

But in best case it have sense to move TFLite in separate isolate. Could be done while registering TFLite in that isolate (on app creation) - not easy but a solution

VadymPinchuk avatar Sep 28 '20 09:09 VadymPinchuk

Even I have a similar use case for my app (run Tflite.runPoseNetOnFrame on an isolate). Would be keen to hear if anyone has tried to move Tflite to an isolate?

saurabhchalke avatar Jan 06 '21 12:01 saurabhchalke

Hi,

I am encountering the same problem : I have display latencies on my screen when showing the camera output, using my own TFLite model and the tflite plugin.

@StevenAtAskAttis @saurabhchalke did you found any solution for this please ?

Larvouu avatar Apr 14 '21 08:04 Larvouu

I'm struggling to move tflite logic into an isolate as well.

ozexpert avatar Sep 16 '22 17:09 ozexpert