TF Lite for Kotlin Multiplatform (jvm, js, ios)?

Hi. I have a mobile application that uses TF Lite. It is implemented and works like a charm.
The target is to migrate the logic from the app to an external multiplatform library using Kotlin Multiplatform.
There are some solutions on GitHub like icerockdev’s moko-tensorflow, but only for Android and IOS.

Did somebody tried to do it for jvm + js + ios ?

Do you know any libs that already provide such functionality ?

Is it even possible to do it ?

Any feedback is highly appreciated.

2 Likes

Hi @CLard,

Does your app already use KMP as you run TFLite for Android, JVM (Desktop), and iOS?
Can you share that project? If you like you can work with me, I have a KMP project on GitHub where I am showing a camera scene from Desktop (JVM), Android and iOS. I am able to view the camera on all platforms and it is possible to take pictures for CV analysis however, I’m unable to implement a TFLite for KMP. I think it will be tedious to use the platform specific TFLite and then using TF for Java (for the JVM Desktop targets)

Have a look and tell me if we can build upon this. southerndevz CameraAI | GitHub I also want an easy way to use ML for all targets with KMP.

Did you manage to figure it out?

No because shorty after the project was dropped / postponed ( not because of TFLite ). Back then i could not find a solution to the problem, but that was 2 years ago. Did not follow up since then.

But if you find a solution please post it here as it might help other , and maybe myself also if we decide to continue thge project after all :slight_smile:

Thanks

Still looking. The original docs for Tensorflow Lite were wiped and replaced with LiteRT which doesn’t support compose multi-platform or any Android version lower than Android 12