/CoreMLSampleiOS

Custom model integration example in iOS using CoreML Model, derived from Keras/TensorFlow

Primary LanguageSwift

TensorFlowForMobile

This is a simple tutorial for implementing machine learning with custom model in mobile apps. This tutorial consists of 3 parts

Repos

Simple TensorFlow Model for computing y= 2x+1. There are 3 repos

  1. Tensorflow model
  2. CoreML model for iOS (using CoreML tools)
  3. TensorflowLite Model for Android.

Model Info

This model is used to calculate 2x+1 value for the given input. Accuracy is 98%.

iOS Project Info

iOS project uses SwiftUI and CoreML. Code is meant to be kept simple. Do not use this for production.

How to use

  1. Go to colab.google.com
  2. Clone and Open the jupyter notebook(ipynb) in this repo
  3. Click 'Connect' and wait till you get a free connection to google compute python backend
  4. Run the code
  5. Download SampleMLModel.mlmodel and replace the existing 'SampleMLModel.mlmodel' in 'ml' folder
  6. Run the iOS app
  7. Select the input via Slider in the iOS Simulator
  8. Output in displayed below

Alternatively, I have included my training model in this repo and so you can do steps #6-#8 .

Screenshot

Screenshot

My consulting site

okchanges.com