10

Recently, I want to deploy a Deeplearning model (Tensorflow) on mobile (Android/iOS) and I found that Kivy Python is a good choice to write cross-platform apps. (I am not familiar with Java Android)

But I don't know how to integrate Tensorflow libs when building .apk file. The guide for writing "buildozer recipe" is quite complicate for this case.

Is there any solution for this problem without using native Java Android and Tensorflow Lite?

Vũ Sinh
  • 111
  • 1
  • 5
  • It's probably possible to somehow use tensorflow from a Kivy app, but it will be tricky and as far as I know nobody has ever pushed through to get it working. The immediate problem is, even if you can build tensorflow and include it in your kivy app it doesn't include the python api on Android, so you need to find a way to add it (probably not easy) or not use the Python api (maybe can be done with pyjnius, not the same as on the desktop for sure). – inclement Jul 10 '19 at 20:56

3 Answers3

2

I had this problem recently, I solved it, it works perfectly. You can have a look.

https://github.com/azizovrafael/Kivy_Tensorflow_Android

  • 2
    “While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.” – Patrick Yoder Jul 17 '22 at 15:46
  • Isn't this just copied code from https://github.com/teticio/kivy-tensorflow-helloworld ? You should at least cite the source from which you got the code instead of claiming that you were the one who "solved it" – hypadr1v3 Nov 15 '22 at 04:28
  • None of the pypi packages used in the repository have the correct version information. If someone is doing research on this, they probably found this repository, and if they came and found it, if they used it, it would be useful. – azizovrafael Dec 10 '22 at 15:20
0

Fortunately found someone facing the same issues as I am but unfortunately I found that Kivy couldn't compile Tensorflow library yet. In other words, not supported, yet. I don't know when will they update the features.

0

Few months ago, i did an experiment for supporting tensorflow in Kivy application. You'll find a minimal example that have a buildozer.spec including tensorflow, a python library, and an example using it.

You can find it on github at https://github.com/tito/experiment-tensorflow-lite

tito
  • 12,990
  • 1
  • 55
  • 75