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.4.tar.gz (359.0 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.4-py3-none-any.whl (309.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for onnxifier-2.0.4.tar.gz
Algorithm Hash digest
SHA256 022f6ba95abefadc45bc6020dc375a45ee052a9325ba64d524854f1397d58e8e
MD5 c59b400196faa4a48867651b8d3690dc
BLAKE2b-256 11adc4637f34669ed4739491e5278937491ce867c25ae6d9a3b5e016ca333e9a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for onnxifier-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a65662d7ae52e3e6ed518d00555d5fbef66b38b573ce4b8701b76f78ec2c41a0
MD5 c0ab4609c8001a4b739e374994bf4f12
BLAKE2b-256 5b803c77128bb5253823aa4fe5a9001f2653fbd46a7f9c42608ba029c8f22dde

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