# qtimlonnx

The mlonnx plugin provides ONNX (Open Neural Network Exchange) model inference capabilities within GStreamer pipelines. It leverages ONNX Runtime with support for multiple execution providers including CPU and Qualcomm QNN (Qualcomm Neural Network) hardware acceleration.

This plugin does the following:

- Accepts a tensor prepared by the preprocessing elements such as qtimlvconverter.
- Produces output tensor that's parsed by the postprocessing plugins such as qtimlvclassification, qtimlvdetection, qtimlvsegmentation, and qtimlvpose.
- Uses the Qualcomm Neural Network (QNN) backend library.
- Uses the ION/DMA buffers allocated by the GstMLBufferPool custom buffer pool class through IOCTL commands to the kernel.

The model and delegate usage is as follows:

- To use a model, provide the absolute path of the model through the model property.

    After it's loaded, the model file provides the input and output capabilities:

    - Number of tensors
    - Dimensions
    - Type
- If the execution-provider is not specified then default is CPU.

## Inheritance chain

[GObject](https://docs.gtk.org/gobject/) → [GstObject](https://gstreamer.freedesktop.org/documentation/gstreamer/gstobject.html?gi-language=c) → [GstElement](https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c) → [GstBaseTransform](https://gstreamer.freedesktop.org/documentation/base/gstbasetransform.html?gi-language=c)→ GstMLOnnx

The following tables provide information on pad templates and element properties of qtimlonnx.

## Pad configuration

| Pad Name | Capabilities | Capabilities | Capabilities |
| --- | --- | --- | --- |
| SINK template: 'sink'<br><ul class="simple"><br><li><p><em>Availability:</em>  Always</p></li><br><li><p><em>Direction:</em>  sink</p></li><br></ul> | neural-network/tensors | type: | { (string)INT8, (string)UINT8, (string)INT16, (string)UINT16, (string)INT32, (string)UINT32, (string)INT64, (string)UINT64, (string)FLOAT16, (string)FLOAT32 } |
| SRC template: 'src'<br><ul class="simple"><br><li><p><em>Availability:</em>  Always</p></li><br><li><p><em>Direction:</em>  source</p></li><br></ul> | neural-network/tensors | type: | { (string)INT8, (string)UINT8, (string)INT16, (string)UINT16, (string)INT32, (string)UINT32, (string)INT64, (string)UINT64, (string)FLOAT16, (string)FLOAT32 } |

## Element configuration

Table : Element properties of qtimlonnx

| Property | Description |
| --- | --- |
| name | The name of the object.<br><ul class="simple"><br><li><p>flags: readable, writable</p></li><br><li><p>String. Default: "mlonnx0"</p></li><br></ul> |
| parent | The parent of the object.<br><ul class="simple"><br><li><p>flags: readable, writable</p></li><br><li><p>Object of type "GstObject"</p></li><br></ul> |
| model | The model file name.<br><ul class="simple"><br><li><p>flags: readable, writable</p></li><br><li><p>String. Default: null</p></li><br></ul> |
| optimization-level | ONNX runtime graph optimization level<br><ul><br><li><p>flags: readable, writable</p></li><br><li><p>Enum "GstMLOnnxOptimizationLevel" Default: 2, "enable-extended"</p><br><blockquote><br><div><ul class="simple"><br><li><p>(0): disable-all - Disable all optimizations</p></li><br><li><p>(1): enable-basic - Enable basic optimizations</p></li><br><li><p>(2): enable-extended - Enable extended optimizations</p></li><br><li><p>(3): enable-all - Enable all optimizations</p></li><br></ul><br></div></blockquote><br></li><br></ul> |
| execution-provider | ONNX runtime execution provider<br><ul><br><li><p>flags: readable, writable</p></li><br><li><p>Enum  "GstMLOnnxExecutionProvider" Default: 0, "cpu"</p><br><blockquote><br><div><ul class="simple"><br><li><p>(0): cpu - CPU execution provider</p></li><br><li><p>(1): qnn - Qualcomm QNN execution provider</p></li><br></ul><br></div></blockquote><br></li><br></ul> |
| backend-path | Absolute file path to QNN backend library. Provide the QNN backend library path for execution-provider 'qnn'.<br><ul class="simple"><br><li><p>flags: readable, writable</p></li><br><li><p>String. Default: null</p></li><br></ul> |
| qos | Handle the quality-of-service events.<br><ul class="simple"><br><li><p>flags: readable, writable</p></li><br><li><p>Boolean. Default: false</p></li><br></ul> |
| threads | The number of threads.<br><ul class="simple"><br><li><p>flags: readable, writable</p></li><br><li><p>Unsigned Integer. Range: 1 - 16, Default: 1</p></li><br></ul> |

Last Published: Apr 02, 2026

[Previous Topic
qtimlqnn](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/qtimlqnn.md) [Next Topic
qtimlpostprocess](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/qtimlpostprocess.md)

Source: [https://docs.qualcomm.com/doc/80-70029-50/topic/qtimlonnx.html](https://docs.qualcomm.com/doc/80-70029-50/topic/qtimlonnx.html)