This is a simple tutorial for implementing machine learning with custom model in mobile apps. This tutorial consists of 3 parts
Simple TensorFlow Model for computing y= 2x+1. There are 3 repos
This model is used to calculate 2x+1 value for the given input. Accuracy is 98%.
Android Project Info
Android project uses Jeptack Compose and TensorflowLite. Code is meant to be kept simple. Do not use this for production.
How to use
- Go to colab.google.com
- Clone and Open the jupyter notebook(ipynb) in this repo
- Click ‘Connect’ and wait till you get a free connection to google compute python backend
- Run the code
- Download SampleTFLiteModel.tflite and replace the existing ‘SampleTFLiteModel.tflite’ in ‘ml’ folder
- Run the android app
- Select the input via Slider in the emulator
- Output in displayed below
Alternatively, I have included my training model in this repo and so you can do steps #6-#8 .