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, at https://developer.apple.com/machine-learning/. This website contains several of the most popular models. At the time of writing, most of these models are focused on recognizing dominant objects in an image, and 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. If your needs do not fit the converters that Apple provides, you can extend the toolchain, since the conversion tools are open source. This means that everybody can add their own converters, or tweak existing converters.

Converting CoreML models using Apple's tools can usually be done with a couple of lines of Python. Writing a good conversion script does typically involve a little bit of domain knowledge in the area of machine learning, because you'll need to make sure that the converted model works just as well as the original model.

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

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.190.159.10