https://github.com/zpye/SimpleInfer
A simple neural network inference framework
https://github.com/zpye/SimpleInfer
ai-framework cpp deep-learning inference-engine neural-network xmake
Last synced: 10 months ago
JSON representation
A simple neural network inference framework
- Host: GitHub
- URL: https://github.com/zpye/SimpleInfer
- Owner: zpye
- License: mit
- Created: 2023-03-17T17:31:35.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-01T03:00:20.000Z (over 2 years ago)
- Last Synced: 2024-10-24T13:58:58.127Z (about 1 year ago)
- Topics: ai-framework, cpp, deep-learning, inference-engine, neural-network, xmake
- Language: C++
- Homepage: https://github.com/zpye/SimpleInfer
- Size: 2.15 MB
- Stars: 22
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SimpleInfer 
SimpleInfer is a neural network inference framework based on [KuiperInfer](https://github.com/zjhellofss/KuiperInfer).
## Build
SimpleInfer uses [xmake](https://xmake.io/#/) to build library and tests.
```shell
git clone --recursive https://github.com/zpye/SimpleInfer.git
cd SimpleInfer
xmake config -a x64 -m release
xmake -w --all
```
## Run
After building successfully, run test-yolo to check.
```shell
xmake run test-yolo
```
## YOLO Result
Here are visualized results of YOLO detection.




## Working With Python
1. Set environment `PYTHON_ROOT` where `python` binary exists, pybind11 needs `${PYTHON_ROOT}/include` and `${PYTHON_ROOT}/libs` for compiling and linking.
2. Set `--build_python=true` after `xmake config` and build:
```shell
xmake config -a x64 -m release --build_python=true
xmake -w --all
```
3. install package by pip:
```shell
pip install build/python/
```
4. run python test:
```shell
python test/test_python/test_model.py
```
## (Experimental) Halide Programming
Note: Only upsample nearest layer has an implementation of Halide.
1. Set environment `HALIDE_ROOT` for Halide installation path, using release packages from [https://github.com/halide/Halide/releases](https://github.com/halide/Halide/releases) is a good choice.
2. Set `--halide=true` after `xmake config` and build:
```shell
xmake config -a x64 -m release --halide=true
xmake build halide_layers
xmake -w --all
```
## Reference
[KuiperInfer](https://github.com/zjhellofss/KuiperInfer) -> basic framework
[ncnn](https://github.com/Tencent/ncnn), [simpleocv](https://github.com/zpye/simpleocv) -> pnnx ir, simpleocv and mat-pixel operations
[Eigen](https://gitlab.com/libeigen/eigen), [tensorflow](https://github.com/tensorflow/tensorflow) -> Eigen tensor
[abseil](https://github.com/abseil/abseil-cpp) -> logging, string format operations
[CGraph](https://github.com/ChunelFeng/CGraph) -> graph based pipeline
[highway](https://github.com/google/highway), [Simd](https://github.com/ermig1979/Simd) -> SIMD, GEMM, Winograd, parallel
[benchmark](https://github.com/google/benchmark), [Catch2](https://github.com/catchorg/Catch2) -> benchmark and unit tests
[pybind11](https://github.com/pybind/pybind11) -> python bindings of c++
[stb](https://github.com/nothings/stb) -> image loader and image writer
[Halide](https://github.com/halide/Halide) -> Halide programming
[tmp](https://github.com/zjhellofss/tmp) -> pnnx models