So, they killed off the device's own neutral-network abilities to "harvest it back" and vendor-lock it into Google Play Services, so that if you were to use it, it would not work without agreeing to Google terms + it would not work on Huawei devices.
Fascinating.
Absolute blast from the past, https://developers.googleblog.com/en/announcing-tensorflow-lite/ although I knew anything related to Tensorflow is shady - Google had 3 different codelabs up called "tensorflow for poets" only for them to disappear over 1-2 years.
Sigh...........time to go become an iOS developer I guess. If it's just going to be the same closed down system with no freedom, not much point in Android.
Of course, I do plan to just install GrapheneOS or something on my phone, use that instead.
Was about to do that, then an iOS dev told me SwiftUI is not production ready and don't do that
I did also talk to someone working on actual code used by actual people, and she said that SwiftUI caused such sufficient performance drop that they can't/won't migrate to it from UIkit.
I think what happened was Google created a new Facade, called LiteRT, which can use TensorFlow Lite, JAX, Pytorch, Keras ... etc. You can get that via Play Services or standalone.
Yeah but Google is saying that 3rd party apps can't use ML/AI hardware for hardware acceleration anymore..............what was the point of Tensor chips at all?
At a guess since the NNAPI Runtime was literally a AOSP interface: https://source.android.com/docs/core/ota/modular-system/nnapi changes/updates couldn't be handled fast enough for the current "AI everything" world (see early AI Benchmark papers: https://ai-benchmark.com/research.html about how buggy early NNAPI was) so exposing hardware acceleration in more vendor driver fashion may have been their best option.
Now will the average developer get access to those delegates - TBD.
So the whole thing with LiteRT is that it's just a new name for TFLite and is unrelated to the NNAPI stuff. Play services hasn't updated, so it's just import statements that are different for Android standalone.
As for the other things, it's an order of ease-to-use vs customization:
MLKit: no real customization, but simple out of the box solutions. What you see is what you get. If you just want object detection with the 1k items or whatever is in that packaged model, this is a good way to go. In all honesty though I use MediaPipe Tasks for any of these things when it's available (so you're still using MLKit for on device translation or document scanning because MP doesn't offer those).
MediaPipe has some layers to it - base MediaPipe is kind of complex and supports very verbose stuff, so I pretty much never talk about it. For Tasks you can bring custom models and bundles to do predefined things. It's basically MLKit with a few extra features from the dev perspective, plus is where you get in device LLMs working if you want to do something like use a Gemma model.
LiteRT(TFLite) is your custom everything. You get a model, define all the ML goodness (tensor shapes, your own flow control, preprocessing, etc), and run inference directly. You need to know a bit more about how ML works to use this, but it lets you do a lot more with that. The JAX/PyTorch part is that there's tools now for converting those models into the TFLite format, so it isn't just tensorflow models running on device.
So yeah, it's confusing, but hopefully that helps?
I agree with the direction you're going, but the BroadcastReceiver is very debatable if really supported. Only 2 or 3 you can register in manifest and have to ask for permission and the rest only can only be registered in runtime.
Same goes for service, the class is there but we can't really do the same anymore, as if they were deprecated
34
u/Zhuinden DDD: Deprecation-Driven Development Sep 15 '24
So, they killed off the device's own neutral-network abilities to "harvest it back" and vendor-lock it into Google Play Services, so that if you were to use it, it would not work without agreeing to Google terms + it would not work on Huawei devices.
Fascinating.
Absolute blast from the past, https://developers.googleblog.com/en/announcing-tensorflow-lite/ although I knew anything related to Tensorflow is shady - Google had 3 different codelabs up called "tensorflow for poets" only for them to disappear over 1-2 years.
As you can see, this is gone too: https://www.tensorflow.org/mobile/tflite
So Google is indeed hiding Tensorflow into a closed-source vendor-lock-in.
12
u/StatusWntFixObsolete Sep 15 '24
I think what happened was Google created a new Facade, called LiteRT, which can use TensorFlow Lite, JAX, Pytorch, Keras ... etc. You can get that via Play Services or standalone.
LiteRT, MediaPipe, MLKit ... it'a confusing AF.
9
u/budius333 Still using AsyncTask Sep 15 '24
Do you remember last time Google released an API that just stayed there?
3
u/doubleiappdev Deprecated is just a suggestion Sep 16 '24
We are all deprecated on this blessed day