- ModelRunntime is a collection of model inference runtime examples covering multiple programming languages and model formats.
- Each subdirectory is an independent runtime example. All model-specific dynamic parameters—including model paths, input and output tensor names, input dimensions, class counts, quantization parameters, and devices—are represented by
TODOcomments and must be filled in for the actual model before use. - Input images such as
example.pngandexample2.png, together with the required model files, must be prepared by the user where they are not already present.
| Directory | Model format | Runtime / framework | Description |
|---|---|---|---|
| python_onnx | ONNX (.onnx) |
onnxruntime | Complete YOLOv5n object-detection example with NMS and visualization |
| python_pb | TensorFlow (.pb) |
tensorflow>=2.16 | YOLOv3-ResNet18 object detection (tf.compat.v1 frozen graph) with a Dockerfile |
| python_pth_pt | PyTorch (.pt / .pth) |
torch | YOLOv5s weight-loading example |
| python_tflite | TensorFlow Lite (.tflite) |
tensorflow | TFLite interpreter inference with quantization notes |
| python_tf_savedmodel | TF2 SavedModel | tensorflow | SavedModel signature inference |
| python_keras_h5 | Keras (.h5 / .keras) |
keras | Keras model loading and prediction |
| python_torchscript | TorchScript (.pt) |
torch | torch.jit.load inference on CPU or CUDA |
| python_paddle | PaddlePaddle (.pdmodel / .pdiparams) |
paddlepaddle | Paddle Inference example |
| python_openvino | OpenVINO IR (.xml / .bin) |
openvino | OpenVINO Core inference |
| python_tensorrt | TensorRT (.engine) |
tensorrt + pycuda | TensorRT engine deserialization and inference |
| python_caffe | Caffe (.prototxt + .caffemodel) |
opencv-python | Loading Caffe through OpenCV DNN |
| python_gguf | GGUF (.gguf) |
llama-cpp-python | Large language model conversation and generation |
| python_jax | JAX / Flax checkpoint | jax + flax | JAX / Flax parameter loading and inference |
| Directory | Model format | Runtime / framework | Description |
|---|---|---|---|
| cpp_onnxruntime | ONNX (.onnx) |
ONNX Runtime C++ | Native ONNX Runtime session inference |
| cpp_opencv_dnn | ONNX / Caffe / TF / Darknet | OpenCV DNN | General inference through OpenCV readNet |
| cpp_tensorrt | TensorRT (.engine) |
TensorRT + CUDA | TensorRT engine deserialization and execution context |
| cpp_libtorch | TorchScript (.pt) |
LibTorch | PyTorch inference in C++ |
| cpp_openvino | OpenVINO IR (.xml / .bin) |
OpenVINO C++ | OpenVINO compiled-model inference |
| cpp_tflite | TensorFlow Lite (.tflite) |
TFLite C++ | TFLite interpreter inference |
| Directory | Model format | Runtime / framework | Description |
|---|---|---|---|
| go_onnxruntime | ONNX (.onnx) |
onnxruntime_go | ONNX Runtime in Go |
| go_tflite | TensorFlow Lite (.tflite) |
go-tflite (+XNNPACK) | TFLite inference in Go |
| go_gguf | GGUF (.gguf) |
llama.cpp (llama-cli) |
Go invokes a llama.cpp subprocess for LLM inference |
| Directory | Model format | Runtime / framework | Description |
|---|---|---|---|
| rust_tract | ONNX / TF (.onnx, etc.) |
tract-onnx | Lightweight inference with tract |
| rust_candle | safetensors / .pt |
candle-core | PyTorch-style inference with Candle |
| rust_ort | ONNX (.onnx) |
ort | ONNX Runtime Rust bindings |
| Directory | Model format | Runtime / framework | Description |
|---|---|---|---|
| java_onnxruntime | ONNX (.onnx) |
onnxruntime-java | ONNX Runtime in Java |
| java_djl | Multiple formats (MXNet / PyTorch / ONNX, etc.) | Deep Java Library | Unified DJL model loading and translators |
| Directory | Model format | Runtime / framework | Description |
|---|---|---|---|
| csharp_onnxruntime | ONNX (.onnx) |
Microsoft.ML.OnnxRuntime | ONNX Runtime in .NET |
| Directory | Model format | Runtime / framework | Description |
|---|---|---|---|
| node_onnxruntime | ONNX (.onnx) |
onnxruntime-node | ONNX Runtime in Node.js |
| node_tfjs | TF SavedModel / TF.js | @tensorflow/tfjs-node | TensorFlow.js inference |
- Enter the relevant subdirectory and inspect the language or framework's
mainfile and dependency manifest. - Replace every
TODOplaceholder with the actual model path, input and output names, input dimensions, class count, and other model-specific dynamic parameters. - Prepare the input images and model files, then build or run the example using its manifest: Python
requirements.txt, C++CMakeLists.txt, Gogo.mod, RustCargo.toml, Javapom.xml, C#.csproj, or Node.jspackage.json.