Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need new versions of tflite binaries #3

Closed
JSYRD opened this issue Apr 27, 2023 · 5 comments
Closed

We need new versions of tflite binaries #3

JSYRD opened this issue Apr 27, 2023 · 5 comments

Comments

@JSYRD
Copy link

JSYRD commented Apr 27, 2023

To use the plugin, an initial setup, which is marked important in the README, is needed. However, the links in the install.sh and install.bat still refer to the origin releases, and they are already expired. We need the latest versions of tflite binaries as releases, to replace the url in the initial setup scripts.

And also, we need to publish a new wiki to guide the users to build their own versions of tflite binaries. I've successfully done this, but there's still something baffle me, especially the usage of bazzel.

@PaulTR
Copy link
Collaborator

PaulTR commented Apr 27, 2023

This'll come at some point soon. There's 2-3 years of updates to do to make this work :)

@PaulTR
Copy link
Collaborator

PaulTR commented Apr 27, 2023

Alright another contributor and I did a quick pass to at least make the examples work using the older (2.5) version of TensorFlow. Android and iOS should be usable now - you'll just need to copy the files from https://github.com/tensorflow/flutter-tflite/tree/main/releases/download/android into your project's /android/app/src/main/jniLibs directory for using an Android app (that's really all the install.sh and install.bat files did, but it was an extra layer of complexity that I kept seeing pop up in the issues).

@JSYRD
Copy link
Author

JSYRD commented Apr 28, 2023

Thank you! The libtensorflowlite_gpu_delegate does work, but it's surprisingly so huge(16.6MB). Maybe the nnapi delegate is included.
What's more, the user still need to download the binaries and put them into their project, isn't it? So a script(like the origin install.sh and install.bat) is required, and I wonder if it's possible to provide some way for those with a firewall like users in China like me? I mean, they can browse pub.dev, get plugins, but they can't download these binaries from Github, unless they use VPN to cross the Great FireWall. Maybe it's possible to get in touch with some mirror sites, and guide the users to switch the download site to the mirror ones? Just opinion on my own :) .

@PaulTR
Copy link
Collaborator

PaulTR commented Apr 28, 2023

Thank you! The libtensorflowlite_gpu_delegate does work, but it's surprisingly so huge(16.6MB). Maybe the nnapi delegate is included.
What's more, the user still need to download the binaries and put them into their project, isn't it? So a script(like the origin install.sh and install.bat) is required, and I wonder if it's possible to provide some way for those with a firewall like users in China like me? I mean, they can browse pub.dev, get plugins, but they can't download these binaries from Github, unless they use VPN to cross the Great FireWall. Maybe it's possible to get in touch with some mirror sites, and guide the users to switch the download site to the mirror ones? Just opinion on my own :) .

I didn't realize that would be blocked in China, so that's interesting!

Generally I'd host those files in a Google Cloud storage bucket, but the last time I was in China that was also blocked. The one thing I can think of is when this gets updated from TFLite 2.5 to TFLite 2.9 (this will include some necessary refactoring in the dart code, as well as the example apps - I'm honestly not sure how large of a task this will be, but a PR from the community would be greatly appreciated), that should support gradle dependencies that include the delegates:

implementation 'org.tensorflow:tensorflow-lite:2.9.0'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.9.0'
implementation 'org.tensorflow:tensorflow-lite-support:0.4.2'
implementation 'org.tensorflow:tensorflow-lite-select-tf-ops:2.9.0'

Those are the actual versions I'd use to start, too, since I believe the Play services TFLite dependencies would be blocked.

@PaulTR
Copy link
Collaborator

PaulTR commented May 1, 2023

Closing this out in favor of #16 since new binaries are built, but the plugin will need to be updated to support play services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants