shaqian / flutter_tflite

Flutter plugin for TensorFlow Lite
https://pub.dartlang.org/packages/tflite
MIT License
630 stars 404 forks source link

use Tflite.detectObjectOnFrame in isolate #151

Open ghost opened 4 years ago

ghost commented 4 years ago

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

zbejas commented 4 years ago

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.

ghost commented 4 years ago

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

VadymPinchuk commented 3 years ago

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

saurabhchalke commented 3 years ago

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?

Larvouu commented 3 years ago

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 ?

ozexpert commented 1 year ago

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