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 blackonnx 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 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| blackonnx-1.0.0.tar.gz | 6.1 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| blackonnx-1.0.0-py3.7.egg | Legacy Egg format | - | - | Details |
| blackonnx-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.9 kB
Release files / blackonnx-1.0.0.tar.gz
| Download URL | blackonnx-1.0.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d542b0a3f6b882a83a1054bc8c3590bc693d2ad18f6c824678714f4600769f79
|
|
BLAKE2b-256 checksum How to use checksums |
a406ae5d2b6b35e3ca6d0980b28b866dd1d686eeb4a5dd012e95f6d92dcd8ef1
|
| 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.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
|
Release files / blackonnx-1.0.0-py3.7.egg
| Download URL | blackonnx-1.0.0-py3.7.egg |
|---|---|
| Size | 15.7 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
134a93a0161d4e2a6778991ec597aa389d46cd42d90aa8e7e564d244e892805b
|
|
BLAKE2b-256 checksum How to use checksums |
ac0b9038b578d80ecce1ca27ead5e31011fc8b23a4b74550470e730e2d1215d7
|
| 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.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
|
Release files / blackonnx-1.0.0-py3-none-any.whl
| Download URL | blackonnx-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
324ea249b0deb53d2b92074a2eb73df292e3707271701e8954243286df941876
|
|
BLAKE2b-256 checksum How to use checksums |
c8d11ad26466cb454c21e8775328ca73938315acd3dfba9a405faf109fd33485
|
| 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.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
|