# Image classification and display with ONNX The use cases use an ONNX model to perform scene classification within a single‑camera media pipeline, with inference results overlaid on or composed into the output stream. Run this use case on the target device: export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1 && \ gst-launch-1.0 -v filesrc location=/etc/media/video.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! tee name=split \ split. ! queue ! qtivcomposer name=mixer ! queue ! waylandsink fullscreen=true \ split. ! queue ! qtimlvconverter ! queue ! qtimlonnx model=/etc/models/model.onnx execution-provider=qnn backend-path="/usr/lib/libQnnHtp.so" ! queue ! qtimlpostprocess results=1 module=mobilenet-softmax labels=/etc/labels/classification.json settings="{\"confidence\": 51.0}" ! video/x-raw,format=BGRA,width=640,height=360 ! queue ! mixer. Copy to clipboard Note When using an `ONNXModel`, place the model weight file in the same directory as the ONNX model file and name it `model.data`. To stop the use case, use **CTRL + C**. The following figure shows the flow of the use case execution: 1. Classify scenes from a video stream coming through a camera source. 2. Overlay the classification labels using overlaylib. 3. Display the results. Qualcomm Open source camsrc tee qtimlvconverter qtimlonnx qtimlpostprocess qtivcomposer waylandsink **Figure : Pipeline for classification overlay** The following table provides the sequential processing stages of the pipeline execution: | Process | Description | | --- | --- | | [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70029-50/topic/qtiqmmfsrc.html) |

  1. Collects the video stream (source) and creates two copies of the source:




    • One stream is sent to the qtimetamux plugin to retain the video stream.


    • The other stream is sent to an ML inferencing pipeline.





| | **Preprocessing** | **Preprocessing** | | [qtimlvconverter](https://docs.qualcomm.com/doc/80-70029-50/topic/qtimlvconverter.html) |

  1. Receives the video stream on its sink pad.


  2. Performs preprocessing:




    • Color conversion


    • Scaling down/up


    • Normalization on the stream data when the model expects the floating point values as an input





  3. Converts the video stream to a tensor stream on its source pad.


    The classification model uses this tensor stream for inferencing.



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

  1. Loads the model.


  2. Modifies the graph for the chosen delegate.


  3. Receives the tensor stream on its sinkpad.


  4. Runs the inference and produces a tensor stream with the inference results on its source pad.


| | **Postprocessing** | **Postprocessing** | | qtimlpostprocess |

  1. Receives the inference tensors from a classification model on its sinkpad.


  2. Converts the tensors into formats such as video or text that the multimedia plugins can process later.


  3. Applies the threshold to the chosen number of results.


  4. Loads the corresponding modules of the classification models.


    In this use case, qtimlpostprocess does the following:




    1. Loads the submodule of the model.


    2. Produces results as structures of text.


    3. Sends them to the sinkpad of qtimetamux.





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

  1. Receives the video stream and text stream with classification results corresponding to the video stream on its sinkpads.


  2. Produces GST buffers with the contents of video stream on its sink pad.


  3. Adds classification result from data sinkpad to GST buffer meta (meta muxing) on its source pad.


| | qtivoverlay |

  1. Receives the multiplexed stream.


  2. Overlays the classification labels on the VideoFrame using CL.


  3. Produces GST buffers with overlays in its source pad.


| | **Output** | **Output** | | [Waylandsink](https://docs.qualcomm.com/doc/80-70029-50/topic/waylandsink.html) |

  1. Receives the video stream on its sinkpad.


  2. Submits the video stream to Weston.


  3. Weston renders the video stream and possible classifications generated for that scene on a local display device.


| Last Published: Jun 03, 2026 [Previous Topic ONNX use cases](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/onnx-use-cases.md) [Next Topic Object detection with ONNX](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/object-detection-with-onnx.md) Source: [https://docs.qualcomm.com/doc/80-70029-50/topic/image-classification-with-onnx.html](https://docs.qualcomm.com/doc/80-70029-50/topic/image-classification-with-onnx.html)