ImageClassification by Skafos
ImageClassification is an example app that uses the Skafos platform for CoreML model integration and delivery. It's a good starting point for diving in, or a good reference for integrating Skafos in to your own app. Skafos is a platform that streamlines CoreML model updates without needing to submit a new version to the app store everytime a new model is ready for use.
This ImageClassification example app specifically integrates and deploys an Image Classification machine learning model. Image Classification is a type of machine learning model that enables you to categorize images into groups, and identify new images as a member of one (or more) of these groups. The example model that is provided in this app will categorize any image as either a cat or a dog. For more details about how to use and customize this model please navigate to the Skafos Turi Image Classifier repo on github.
Before diving in to this example application, make sure you have setup an account at Skafos and run through the quickstart
- Clone or fork this repository.
- In the project directory, run
pod install
- Open the project workspace (
.xcworkspace
) - In your project's settings under
General
change the following:- Display Name
- Bundle Identifier
- Team
- Any other settings specific to your app.
- Make sure the following capabilites are enabled:
- Background modes:
Background fetch
andRemote notifications
- Push notifications
- Background modes:
- Inside
AppDelegate.swift
make sure to use your Skafos publishable key in:Skafos.initialize
Now take a moment to click on ImageClassification.mlmodel
and under the Model Class section click the arrow next
to ImageClassification
and have a peek at the class that Xcode generates from the CoreML Model. Now, inside of
MainViewController.swift
(around line 95) take a look at the reloadModel
function to see an example of
how to load a model using the Skafos framework. While in MainViewController.swift
also look (around line 86)
for how to setup NSNotificationCenter
to listen for Skafos notifications that the model has been updated.
Skafos swift framework uses the Apache2 license, located in the LICENSE file.
Contact us by email [email protected]