Skip to main content

An Open Neural Network Exchange (ONNX) Optimization and Transformation Tool.

Project description

ONNXifier

A simple tool to convert any IR format to ONNX file.

Checked with pyright

Framework Status
OpenVINO
ONNXRuntime
  • ✅: well supported
  • 🪛: partially supported
  • 🚧: developing

Usage

  1. Install from PyPI
pip install onnxifier
  1. Convert IR using CLI
onnxify model.xml
usage: onnxify input_model.xml [output_model.onnx]

onnxify command-line api

options:
  -h, --help            show this help message and exit
  -a [ACTIVATE ...], --activate [ACTIVATE ...]
                        select passes to be activated, activate L1, L2 and L3 passes if not set.
  -r [REMOVE ...], --remove [REMOVE ...]
                        specify passes to be removed from activated passes.
  -n, --no-passes       do not run any optimizing passes, just convert the model
  --print [PRINT]       print the name of all optimizing passes
  --format {protobuf,textproto,json,onnxtxt}
                        onnx file format
  -s, --infer-shapes    infer model shapes
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        specify a json-format config file for passes
  -u, --uncheck         no checking output model
  --check               check optimized model with random inputs
  --checker-backend {onnx,openvino,onnxruntime}
                        backend for accuracy checking, defaults to openvino
  -v OPSET_VERSION, --opset-version OPSET_VERSION
                        target opset version, defaults to 19
  -vv [{DEBUG,INFO,WARNING,ERROR,CRITICAL}], --log-level [{DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                        specify the level of log messages to be printed, defaults to INFO
  -R, --recursive       recursively optimize nested functions
  --nodes [NODES ...]   specify a set of node names to apply passes only on these nodes

To print pass information:

onnxify --print all
onnxify --print fuse_swish
onnxify --print l1

TODO

  • [OV] Add Loop support.
  • [OV] Add NMS support.
  • [OV] Add If support.
  • [ONNX] Support to optimize If.

Contribute

  1. pyright type checking
pip install -U pyright
pyright onnxifier
  1. mypy type checking
pip install -U mypy
mypy onnxifier --disable-error-code=import-untyped --disable-error=override --disable-error=call-overload
  1. pre-commit checking
pip install -U pre-commit
pre-commit run --all-files

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

onnxifier-2.0.0.tar.gz (318.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onnxifier-2.0.0-py3-none-any.whl (280.2 kB view details)

Uploaded Python 3

File details

Details for the file onnxifier-2.0.0.tar.gz.

File metadata

  • Download URL: onnxifier-2.0.0.tar.gz
  • Upload date:
  • Size: 318.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for onnxifier-2.0.0.tar.gz
Algorithm Hash digest
SHA256 60e67a84f58ff181f4577ce7815c656e1c2f9fb80d18ea88e362e0541a5ae084
MD5 90e5006829e28984759c80f511fcbcb0
BLAKE2b-256 bfa944a8f111fe1f0391647501078d06c0a3ef8f0babfa19d575f6afd202506b

See more details on using hashes here.

File details

Details for the file onnxifier-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: onnxifier-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 280.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for onnxifier-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2964203341e245d0e5d0f83920325476c195750f59aa632a8450b9bca2ec6003
MD5 629f28937deb13fe16617b8df072972c
BLAKE2b-256 4bc2b69f77e69eb182d2eaaab1bbe5d75693919a992f7b0b95b9b01eddb5416f

See more details on using hashes here.

Supported by

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