Skip to main content

Converts Machine Learning models to ONNX

Project description

https://github.com/onnx/onnxmltools/blob/master/docs/ONNXMLTools_logo_main.png
Build Status Linux Build Status Windows

Introduction

ONNXMLTools enables you to convert models from different machine learning toolkits into ONNX. Currently the following toolkits are supported:

  • Apple CoreML

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

Install

pip install onnxmltools

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 onnxmltools
import coremltools

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

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

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

License

MIT License

Acknowledgments

The initial version of this package was developed by the following developers and data scientists at Microsoft during winter 2017: Zeeshan Ahmed, Wei-Sheng Chin, Aidan Crook, Xavier Dupre, Costin Eseanu, Tom Finley, Lixin Gong, Scott Inglis, Pei Jiang, Ivan Matantsev, Prabhat Roy, M. Zeeshan Siddiqui, Shouheng Yi, Shauheen Zahirazami, Yiwen Zhu.

Project details


Download files

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

Source Distribution

onnxmltools-1.0.0.0.tar.gz (97.2 kB view hashes)

Uploaded Source

Built Distribution

onnxmltools-1.0.0.0-py2.py3-none-any.whl (154.0 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