Skip to main content

blackonnx

This package purpose is to allow the use of NN models generated by AutoML services (Google Cloud Vision, Azure custom Vision), to an Actcast application.

The format for NN models in Actcast is nnoir, and the tool nnoir-onnx allows conversion from ONNX format to nnoir.

Some ONNX operators used in AutoML-generated models may not be supported by nnoir-onnx, and using this package allows the conversion by modifying an onnx model by replacing unsupported nodes to equivalent supported ones.

See #Examples section for use samples.

Installation

pip3 install blackonnx

Usage

In a python script:

import onnx
from blackonnxlib import fix

model = onnx.load("path/to/mymodel.onnx")  # open onnx model

fix.fix_quantize(model)  # apply fixes in-place
.
.
.

onnx.save(model, "mymodel_fixed.onnx")  # save fixed model

or using commd line:

user~$ blackonnx -o mymodel_fixed.onnx path/to/mymodel.onnx --fixes fix_quantize 

Omitting fixes argument applies all fixes (in alphabetical order). For models created with Google Cloud Vision, the recommanded fixes are

... --fixes fix_quantize 

And for Azure custom vision models:

... --fixes fix_postprocess 

Example

Follow the instructions in examples/tutorial.md for details.

Origin of the Name

The name blackonnx comes from black onyx because of the property: artificially colored to black. Our IR is nnoir, which comes from black in french. We mean this tool adapt onnx models for nnoir.

Metadata

Release files for blackonnx 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for blackonnx 0.1.0
File Interpreter ABI Platform
blackonnx-0.1.0-py3-none-any.whl Python 3 none any Details

Release files / blackonnx-0.1.0-py3-none-any.whl

Download URL blackonnx-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6406d9be774c5f4dfaf5e9bf5e4314c895a3c12ea538cf619afda89c3479e05c
BLAKE2b-256 checksum
How to use checksums
203e6a20ea95108075486b347aff8918833a24733e4b291afd7d72805df4544e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

Release history Release notifications | RSS feed

1.0.0

3 release files

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page