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 CoreML

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

  • xgboost

  • libSVM

  • RevoScalePy

  • Keras

Install

pip install winmltools

Dependancies

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

Example

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")

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.725-py2.py3-none-any.whl (22.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file winmltools-1.2.0.725-py2.py3-none-any.whl.

File metadata

  • Download URL: winmltools-1.2.0.725-py2.py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for winmltools-1.2.0.725-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3ee8cbb8078a263bf9f6bc08fbda58468aa400890b5b412d9eeca90a68fb1689
MD5 9a8f23cb37a6a1a40f1fcfca2c94b6d5
BLAKE2b-256 2d1c186705470189fe0872d3a5a4f803772c66cb7c20f52ce343b65cb7a15973

See more details on using hashes here.

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