Skip to main content

Converts Machine Learning models to ONNX for use in Windows ML

Project description

Introduction

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

  • Apple Core ML

  • scikit-learn (subset of models convertible to ONNX)

  • xgboost

  • libSVM

  • Keras

Install

pip install winmltools

Dependencies

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

Example

Here is a simple example to convert a Core ML 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")

License

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.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

winmltools-1.2.0.904-py2.py3-none-any.whl (23.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page