ONNX-Darknet Op Coverage Status
Running an ONNX model using Darknet
Exporting a Darknet Model to ONNX
ONNX-DN requires ONNX (Open Neural Network Exchange) as an external dependency, for any issues related to ONNX installation, we refer our users to ONNX project repository for documentation and help. Notably, please ensure that protoc is available if you plan to install ONNX via pip.
The specific ONNX release version that we support in the master branch of ONNX-DN can be found here. This information about ONNX version requirement is automatically encoded in setup.py
, therefore users needn't worry about ONNX version requirement when installing ONNX-DN.
To install the latest version of ONNX-DN via pip, run pip install onnx-dn
.
Because users often have their own preferences for which variant of Darknet to install (i.e., a GPU version instead of a CPU version), we do not explicitly require Darknet in the installation script. It is therefore users' responsibility to ensure that the proper variant of Darknet is available to ONNX-DN.
For backend, run python -m unittest discover test
.
In this example, we will define and run a Relu node and print the result. This example is available as a python script at example/relu.py .
from onnx_darknet.backend import run_node
from onnx import helper
node_def = helper.make_node("Relu", ["X"], ["Y"])
output = run_node(node_def, [[-0.1, 0.1]])
print(output["Y"])
The result is [ 0. 0.1]
- Install ONNX master branch from source.
- Install Darknet>=1.5.0.
- Run
git clone https://github.com/minhoolee/onnx-darknet.git && cd onnx-darknet
. - Run
pip install -e .
.
- onnx_darknet main source code file.
- test test files.
- Format code:
pip install yapf
yapf -rip --style="{based_on_style: google, indent_width: 2}" $FilePath$
- Install pylint:
pip install pylint
wget -O /tmp/pylintrc https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/tools/ci_build/pylintrc
- Check format:
pylint --rcfile=/tmp/pylintrc myfile.py
http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
https://docs.python.org/2/library/unittest.html
Mark Lee
Significant contributions from onnx-tensorflow team made it possible to implement onnx-darknet