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
-
Checkout ONNX Runtime
$ git clone https://github.com/microsoft/onnxruntime.git
-
Place your model in the folder named model.onnx
-
Create a virtual environment
$ python3 -m venv venv
-
Activate it
$ source ./venv/bin/activate
-
Install dependencies
$ pip install -r requirements.txt
-
Run
$ ./convert-model-to-ort.sh model.onnx
-
Build static libraries using one of the
build-xxx.sh
shell scripts