Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile .mlmodel to .mlmodelc for Xamarin.iOS?

I want to use CoreML for my Xamarin.iOS app but how can I use models? All samples in developer.xamarin is use .mlmodelc but I downloaded .mlmodel. How can I convert to .mlmodelc?

like image 431
Tuğçe Arar Avatar asked Oct 19 '25 21:10

Tuğçe Arar


2 Answers

You can use Xcode to compile your model:

xcrun coremlcompiler compile MyModel.mlmodel MyModel.mlmodelc

This outputs an .mlmodelc that you can add to your project.

Or you can do it dynamically inside your app by using MLModel.compileModel(at:).

like image 129
Matthijs Hollemans Avatar answered Oct 22 '25 11:10

Matthijs Hollemans


You can also use this command in Mac terminal:

/Applications/Xcode.app/Contents/Developer/usr/bin/coremlc compile coreml.mlmodel
like image 37
冯剑龙 Avatar answered Oct 22 '25 12:10

冯剑龙



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!