Building Flutter apps that use Tensorflow Lite #1372
-
Hello, plugin that we use to communicate with Tensorflow Lite model is tflite_flutter To make it work, I have to put some files in the specific locations outside of the project: Android Execute sh install.sh (Linux) / install.bat (Windows) at the root of your project to automatically download and place binaries at appropriate folders. Note: The binaries installed will not include support for GpuDelegateV2 and NnApiDelegate however InterpreterOptions().useNnApiForAndroid can still be used. Use sh install.sh -d (Linux) or install.bat -d (Windows) instead if you wish to use these GpuDelegateV2 and NnApiDelegate. These scripts install pre-built binaries based on latest stable tensorflow release. For info about using other tensorflow versions follow instructions in wiki. iOS ~/.pub-cache/hosted/pub.dartlang.org/tflite_flutter-/ios/ (Linux/ Mac) Is there way to make it with CodeMagic? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello @maciejbrzezinski, Yes, you can run shell scripts, move files, and download any files using the scripts section in the
That's from our docs. |
Beta Was this translation helpful? Give feedback.
-
Thanks and sorry for not looking onto the docs first 🤦♂️ Solution if anyone need that in the future - add a pre-build script: flutter clean |
Beta Was this translation helpful? Give feedback.
Thanks and sorry for not looking onto the docs first 🤦♂️
Solution if anyone need that in the future - add a pre-build script:
flutter clean
dart pub cache add tflite_flutter --version "0.9.0"
dart pub cache repair
flutter pub get
sh install.sh
cd $HOME/.pub-cache/hosted/pub.dev/tflite_flutter-0.9.0/ios
wget https://github.com/am15h/tflite_flutter_plugin/releases/download/v0.5.0/TensorFlowLiteC.framework.zip
unzip TensorFlowLiteC.framework.zip
cd $HOME/clone/ios
pod install