Fields of Blue by Exphrasis

Adding CoreML model to your Xamarin.iOS Projects

Tuğçe Arar
Nov 17, 2021


CoreML allows us to develop a Machine Learning project on iOS. Applications developed using CoreML can perform all kinds of tasks such as problem solving, image recognition using trained models.

We can do this with Xamarin.iOS. The first thing you have to do for this is to set ourselves a model. We download a model from the link below:

We then have to convert it to mlmodelc type to add Xamarin project. We can use Xcode or terminal for this. We should right click on folder that include our CoreML model and then select New Terminal at Folder. After that write tihs command in terminal;

xcrun coremlcompiler compile MyModel.mlmodel MyModel.mlmodelc

this gives us the output of .mlmodelc which we can use in our project. Once we add this model to our project, we can start to develop.