There are two popular approaches regarding how to deploy a machine learning model to a mobile device with Android. We can either use the PyTorch framework, which now incorporates Caffe2, or we can use the TensorFlow Lite framework. We'll use the PyTorch framework in this chapter since we have discussed it in the previous chapters.
Image classification on Android mobile
The mobile version of the PyTorch framework
There is no available binary distribution of PyTorch for mobile devices, so we need to build it from source code. We can do this in the same way as we compile its regular version but with additional CMake parameters to enable mobile mode. You also have to install the Android Native Development Kit (NDK), which...