Using CoreML for image classification

The first thing we will do is add the CoreML model to the HotDogOrNot.iOS project by going through the following steps:

  1. Extract the ZIP file that we get from the Custom Vision service.
  2. Find the .mlmodel file and rename it as hotdog-or-not.mlmodel.
  3. Add it to the Resources folder in the iOS project.
  4. Make sure that the build action is BundleResource. If you are using Visual Studio on a Mac, a .cs file will be created. Remove this file, because it will be easier to use the model without the code.

When we have added the file to the iOS project, we will be ready to create the iOS implementation of the IClassifier interface by going through the following steps:

  1. Create a new class called CoreMLClassifier ...

Get Xamarin.Forms Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.