Giter VIP home page Giter VIP logo

onnxmltools's Introduction

Linux Windows
Build Status Build status

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)

(To convert ONNX model to CoreML, see onnx-coreml)

Getting Started

Clone this repository on your local machine.

Install

You can install latest release of ONNXMLTools from pypi:

pip install onnxmltools

or install from source:

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

Note:If you choose to install onnxmltools from its source code, you must set an environment variable ONNX_ML=1 before installing onnx package.

Dependencies

This package uses ONNX, NumPy, and ProtoBuf. If you are converting a model from scikit-learn or Apple Core ML 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_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.

onnxmltools's People

Contributors

wschin avatar prasanthpul avatar singlis avatar xadupre avatar lutzroeder avatar shauheen avatar frozengene avatar

Watchers

John Zhang avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.