zeloe / ort-builder

ONNX Runtime static library builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ONNX Runtime static library builder

Converts an ONNX model to ORT format and serializes it to C++ source code, generate custom slimmed ONNX Runtime static libs & xcframework for apple platforms.

The goal here is to create a flexible but tiny inference engine for use in Audio Plug-ins or Mobile apps e.g. iPlug2 example.

The scripts here are configured to create a minimal ORT binary using only the CPU provider. If you want to experiment with GPU inference, Core ML etc, you will have to modify

Instructions:

  1. Checkout ONNX Runtime $ git clone https://github.com/microsoft/onnxruntime.git

  2. Place your model in the folder named model.onnx

  3. Create a virtual environment $ python3 -m venv venv

  4. Activate it $ source ./venv/bin/activate

  5. Install dependencies $ pip install -r requirements.txt

  6. Run $ ./convert-model-to-ort.sh model.onnx

  7. Build static libraries using one of the build-xxx.sh shell scripts

About

ONNX Runtime static library builder

License:MIT License


Languages

Language:C++ 91.4%Language:C 4.4%Language:Shell 3.3%Language:Batchfile 1.0%