Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.52 KB

README.md

File metadata and controls

43 lines (32 loc) · 1.52 KB

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)

Getting Started

Clone this repository on your local machine.

Install

Currently you can install ONNXMLTools from source:

pip install git+https://github.com/onnx/onnxmltools

Dependancies

This package uses NumPy as well as ProtoBuf. Also If you are converting a model from Scikit-learn or Apple CoreML you need the following packages installed respectively:

  1. scikit-learn
  2. CoreMLTools

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 engineers 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.