1 Star 1 Fork 10

kbp / libonnx

forked from xboot / libonnx 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Libonnx

A lightweight, portable pure C99 onnx inference engine for embedded devices with hardware acceleration support.

Getting Started

The library's .c and .h files can be dropped into a project and compiled along with it. Before use, should be allocated struct onnx_context_t * and you can pass an array of struct resolver_t * for hardware acceleration.

The filename is path to the format of onnx model.

struct onnx_context_t * ctx = onnx_context_alloc_from_file(filename, NULL, 0);

Then, you can get input and output tensor using onnx_tensor_search function.

struct onnx_tensor_t * input = onnx_tensor_search(ctx, "input-tensor-name");
struct onnx_tensor_t * output = onnx_tensor_search(ctx, "output-tensor-name");

When the input tensor has been setting, you can run inference engine using onnx_run function and the result will putting into the output tensor.

onnx_run(ctx);

Finally, you must free struct onnx_context_t * using onnx_context_free function.

onnx_context_free(ctx);

Examples

Just type make at the root directory, you will see a static library and some binary of examples and tests for usage.

cd libonnx
make

Screenshots

TBD.

Notes

This library based on the onnx version 1.8.0 with the newest operator set 13 support. The supported operator table in the documents directory.

Links

License

This library is free software; you can redistribute it and or modify it under the terms of the MIT license. See MIT License for details.

MIT License Copyright(c) 2007-2020 Jianjun Jiang <8192542@qq.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

A lightweight, portable pure C99 onnx inference engine for embedded devices with hardware acceleration support. 展开 收起
C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/wu7kun/libonnx.git
git@gitee.com:wu7kun/libonnx.git
wu7kun
libonnx
libonnx
master

搜索帮助