Obtaining CoreML models

The are two ways to obtain a model for you to use in your apps. The simplest way is to find an existing .mlmodel file. You can find several ready to use .mlmodel files on Apple's machine learning website: https://developer.apple.com/machine-learning/. This website contains several popular models that are interesting for a large group of people. At the time of writing, most of these models are focused on recognizing dominant objects in an image, so chances are that you have different needs for your app.

If you're looking for something that isn't already converted by Apple, you can try to look in several places online for a pre-converted .mlmodel file or you can convert an existing model you have found online. Apple has created converters for several popular machine learning formats such as caffe. The conversion tools for converting an existing model to a .mlmodel file are written in Python and they ship as part of Xcode 9. If your needs do not fit the converters that Apple provides, you can easily extend the toolchain since the conversion tools are open source. This means that everybody can easily add their own converters or tweak existing converters.

Once you have obtained a CoreML model for your app by either converting one or using an existing one, you're ready to add it to your project and begin using it. Let's see how to do this next.