anooptomar1 / CoreML-Examples

Examples of using MLCore 2 in an iOS 12 app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CoreML Examples

This project is a simple project that uses Core ML for two different classifications:

  1. Realtime image classification
  2. Prediction of income based on demographics

Realtime Image Classification

This code is loosely based on the example provided by Apple at https://developer.apple.com/documentation/arkit/using_vision_in_real_time_with_arkit

This example simplified the code to focus on the machine learning and added functionality to support image classification against 2 models to compare the results.

The models are

  1. InceptionV3 model included with the original example from Apple. This model file is around 100Mb in size and was build with Core ML under macOS 10.13
  2. Custom model built using CreateML on macOS 10.14 which was trained on CalTech 256 dataset which contains about 30,000 images. The resulting model, using transfer learning and quantization is about 4Mb

Income Prediction

This code uses census information regarding incomes from almost 49,000 adults in 1994 to predict a person's income level based on a small set of demographic data. Information about the dataset can be found at https://archive.ics.uci.edu/ml/datasets/Adult

Key Files

  • CoreML Examples.xcodeproj - The Xcode project for the runtime.
  • AdultIncomePlayground.playground - An Xcode 10 playground to build the adult income classification model. This playground includes the dataset required to train the model.
  • ImageRecogPlaygroud.playground - An Xcode 10 playground to train an image recognition model. You must download the images used by this playground from CalTech 256

Requirements

  1. macOS 10.13 or higher to build the iOS app
  2. macOS 10.14 or higher to rebuild the models
  3. Xcode 10 beta 1 or higher
  4. iOS 13 beta 1 or higher
  5. iPhone or iPad with iOS 14 beta 1 or higher. This code will not run on a simulator due to the use of ARKit.

About

Examples of using MLCore 2 in an iOS 12 app


Languages

Language:Swift 100.0%