I started to work on a Native Extension for TensorFlow Lite, so you can use neural networks in Defold games. The obvious framework pick was TensorFlow Lite, because it’s targeted to mobile devices.
The demo project has pre-trained model for MNIST and it allows you to draw digits and recognize them.
I took the trained model from this project: https://github.com/nex3z/tfmobile-mnist-android
Here’s the current development status:
The extension works only on macOS. I couldn’t make it work on iOS, because the provided TFLite framework is compiled for iOS 9.0, but Defold requires iOS 8.0. I was really surprised when iOS framework worked on macOS!
I tried to compile TFLite myself for iOS 8.0, but the library I got doesn’t work. It seems to load a model fine, but you can’t run it – the app crashes. I tried the library in both iOS native app and in Defold NE. I thought that TFLite really can’t work on iOS 8.0 and re-build the library for iOS 9.0, but it also doesn’t work in the native app, unfortunately. It seems that something is wrong with my build environment.
I’ll try to continue experiments and finally make NE working on iOS and Android.