Skip to main content

Microsoft ML Tool to convert machine learning models to ONNX for use with Windows Machine Learning

Project description


WinMLTools enables you to convert models from different machine learning toolkits into ONNX for use with Windows Machine Learning. Currently the following toolkits are supported:

  • Apple CoreML
  • scikit-learn (subset of models convertible to ONNX)
  • LibSVM
  • XGBoost


pip install winmltools


This converter package extends the functionalities of ONNXMLTools.

scikit-learn is needed to convert a scikit-learn model, coremltools for Apple CoreML.


Here is a simple example to convert a CoreML model:

import winmltools
import coremltools

model_coreml = coremltools.utils.load_spec("image_recognition.mlmodel")
model_onnx = winmltools.convert.convert_coreml(model_coreml, "Image_Reco")

# Save as text
winmltools.utils.save_text(model_onnx, "image_recognition.json")

# Save as protobuf
winmltools.utils.save_model(model_onnx, "image_recognition.onnx")


MIT License

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
winmltools- (20.1 kB) Copy SHA256 hash SHA256 Wheel py2.py3

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page