# Image classification and display with LiteRT

Source: [https://docs.qualcomm.com/doc/80-70023-50/topic/single-camera-stream-with-image-classification-and-display-with-litert.html](https://docs.qualcomm.com/doc/80-70023-50/topic/single-camera-stream-with-image-classification-and-display-with-litert.html)

The use cases use the Inceptionv3 LiteRT model to classify scenes from a single
        camera stream and either overlay or compose the classification labels.

## Use qtivoverlay plugin to apply classification overlay

Run this use case on the target
                device:

    gst-launch-1.0 -e --gst-debug=2 qtiqmmfsrc name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! \
    tee name=split split. ! queue ! qtimetamux name=metamux ! queue ! qtivoverlay ! queue ! waylandsink fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/inception_v3_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 40.0}" results=2 module=mobilenet-softmax labels=/etc/labels/classification.json ! text/x-raw ! queue ! metamux.Copy to clipboard

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.

Figure : Pipeline for classification overlay
                
                <!--?xml version="1.0" encoding="UTF-8"?-->
<svg xmlns="http://www.w3.org/2000/svg" width="755" height="444.133987426757812" viewbox="0 0 755 444.133987426757812">
  <defs>
    <style>.svg-1 .cls-1 { fill: none; stroke: #000; stroke-miterlimit: 10 }
.svg-1 .cls-2 { fill: #fff; font-size: 16px }
.svg-1 .cls-2,.svg-1 .cls-3 { font-family: Roboto-Regular, Roboto }
.svg-1 .cls-4 { fill: #007884 }
.svg-1 .cls-5 { fill: #d2d7e1 }
.svg-1 .cls-6 { fill: #2a2aea }
.svg-1 .cls-3 { font-size: 14px }
.svg-1 .cls-7 { fill: #fafafa }</style>
  </defs>
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect class="cls-7" x=".5" y=".500045776367188" width="754" height="443.1337890625" rx="7.499999999999944" ry="7.499999999999944"></rect>
      <path class="cls-5" d="M747,1c3.85980224609375,0,7,3.14019775390625,7,7v428.133987426757812c0,3.85980224609375-3.14019775390625,7-7,7H8c-3.85980224609375,0-7-3.14019775390625-7-7V8c0-3.85980224609375,3.14019775390625-7,7-7h739M747,0H8C3.581695556640625,0,0,3.581703186035156,0,8v428.133987426757812c0,4.418304443359375,3.581695556640625,8,8,8h739c4.41827392578125,0,8-3.581695556640625,8-8V8c0-4.418296813964844-3.58172607421875-8-8-8h0Z"></path>
    </g>
    <g>
      <g>
        <text class="cls-3" transform="translate(557.492919921875 420.225509643554688)"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect class="cls-6" x="537.241901596624302" y="408.134033203125" width="16" height="16" rx="2" ry="2"></rect>
      </g>
      <g>
        <text class="cls-3" transform="translate(656.07470703125 420.225509643554688)"><tspan x="0" y="0">Open source</tspan></text>
        <rect class="cls-4" x="635.823683009481101" y="408.134033203125" width="16" height="16" rx="2" ry="2"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <line class="cls-1" x1="100" y1="163.134033203125" x2="100" y2="182.393051147460938"></line>
        <polygon points="96.010940551757812 181.225852966308594 100 188.134033203125 103.989059448242188 181.225852966308594 96.010940551757812 181.225852966308594"></polygon>
      </g>
      <g>
        <rect class="cls-4" x="20" y="114.159455974608136" width="160" height="50" rx="4" ry="4"></rect>
        <text class="cls-2" transform="translate(88.910194396972656 142.66615629196167)"><tspan x="0" y="0">tee</tspan></text>
      </g>
      <g>
        <rect class="cls-6" x="20" y="188.134031574221808" width="160" height="50" rx="4" ry="4"></rect>
        <text class="cls-2" transform="translate(44.527488708496094 217.809989929199219)"><tspan x="0" y="0">qtimlvconverter</tspan></text>
      </g>
      <g>
        <line class="cls-1" x1="100" y1="238.134033203125" x2="100" y2="257.393051147460938"></line>
        <polygon points="96.010940551757812 256.225860595703125 100 263.134033203125 103.989059448242188 256.225860595703125 96.010940551757812 256.225860595703125"></polygon>
      </g>
      <g>
        <rect class="cls-6" x="20" y="263.134031574221808" width="160" height="50" rx="4" ry="4"></rect>
        <text class="cls-2" transform="translate(64.679832458496094 292.80999755859375)"><tspan x="0" y="0">qtimlsnpe</tspan></text>
      </g>
      <g>
        <line class="cls-1" x1="100" y1="313.134033203125" x2="100" y2="332.393051147460938"></line>
        <polygon points="96.010940551757812 331.225845336914062 100 338.134017944335938 103.989059448242188 331.225845336914062 96.010940551757812 331.225845336914062"></polygon>
      </g>
      <g>
        <rect class="cls-6" x="20" y="338.134031574221808" width="160" height="49.999999999998181" rx="4" ry="4"></rect>
        <text class="cls-2" transform="translate(37.722801208496094 367.80999755859375)"><tspan x="0" y="0">qtimlpostprocess</tspan></text>
      </g>
      <g>
        <line class="cls-1" x1="180" y1="139.159454345703125" x2="199.259002685546875" y2="139.159454345703125"></line>
        <polygon points="198.091827392578125 143.148521423339844 205 139.159454345703125 198.091827392578125 135.170391082763672 198.091827392578125 143.148521423339844"></polygon>
      </g>
      <g>
        <rect class="cls-6" x="205" y="114.159455974608136" width="160" height="50" rx="4" ry="4"></rect>
        <text class="cls-2" transform="translate(236.140655517578125 143.835336208343506)"><tspan x="0" y="0">qtivcomposer</tspan></text>
      </g>
      <g>
        <line class="cls-1" x1="365" y1="139.159454345703125" x2="384.259033203125" y2="139.159454345703125"></line>
        <polygon points="383.091796875 143.148521423339844 390 139.159454345703125 383.091796875 135.170391082763672 383.091796875 143.148521423339844"></polygon>
      </g>
      <g>
        <rect class="cls-4" x="390" y="114.159455974608136" width="160" height="50" rx="4" ry="4"></rect>
        <text class="cls-2" transform="translate(426.09771728515625 142.66615629196167)"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <polyline class="cls-1" points="180 365.497756958007812 285 365.497756958007812 285 169.800025939941406"></polyline>
        <polygon points="288.98907470703125 170.967216491699219 285 164.059036254882812 281.01092529296875 170.967216491699219 288.98907470703125 170.967216491699219"></polygon>
      </g>
      <rect class="cls-4" x="20" y="24.11389100645647" width="160" height="50" rx="4" ry="4"></rect>
      <text class="cls-2" transform="translate(78.082069396972656 52.620590209960938)"><tspan x="0" y="0">filesrc</tspan></text>
      <g>
        <line class="cls-1" x1="180" y1="49.1138916015625" x2="199.259002685546875" y2="49.1138916015625"></line>
        <polygon points="198.091827392578125 53.102954864501953 205 49.1138916015625 198.091827392578125 45.124826431274414 198.091827392578125 53.102954864501953"></polygon>
      </g>
      <rect class="cls-4" x="205" y="24.11389100645647" width="160" height="50" rx="4" ry="4"></rect>
      <text class="cls-2" transform="translate(253.703155517578125 52.620590209960938)"><tspan x="0" y="0">qtdemux</tspan></text>
      <g>
        <line class="cls-1" x1="365" y1="49.1138916015625" x2="384.259033203125" y2="49.1138916015625"></line>
        <polygon points="383.091796875 53.102954864501953 390 49.1138916015625 383.091796875 45.124826431274414 383.091796875 53.102954864501953"></polygon>
      </g>
      <rect class="cls-4" x="390" y="24.11389100645647" width="160" height="50" rx="4" ry="4"></rect>
      <text class="cls-2" transform="translate(432.20703125 52.620590209960938)"><tspan x="0" y="0">h264parse</tspan></text>
      <g>
        <line class="cls-1" x1="550" y1="49.1138916015625" x2="569.259033203125" y2="49.1138916015625"></line>
        <polygon points="568.091796875 53.102954864501953 575 49.1138916015625 568.091796875 45.124826431274414 568.091796875 53.102954864501953"></polygon>
      </g>
      <g>
        <polyline class="cls-1" points="99.999755859375 108.418472290039062 99.999755859375 94.159456253051758 655 94.159456253051758 655 74.159456014633179"></polyline>
        <polygon points="103.98883056640625 107.25128173828125 99.999755859375 114.159454345703125 96.010696411132812 107.25128173828125 103.98883056640625 107.25128173828125"></polygon>
      </g>
      <rect class="cls-4" x="575" y="24.11389100645647" width="160" height="50" rx="4" ry="4"></rect>
      <text class="cls-2" transform="translate(609.37896728515625 52.620590209960938)"><tspan x="0" y="0">v4l2h264dec</tspan></text>
    </g>
  </g>
</svg>

The following table provides the sequential processing stages of the pipeline
                    execution:

| Process | Description |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70023-50/topic/qtiqmmfsrc.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_l2f_zgm_vbc"><br>                                        <li class="li">Collects the video stream (source) and creates two<br>                                            copies of the source:<ul class="ul" id="single-camera-stream-with-image-classification-and-display__ol_m2f_zgm_vbc"><br>                                                <li class="li">One stream is sent to the qtimetamux plugin to<br>                                                  retain the video stream.</li><br><br>                                                <li class="li">The other stream is sent to an ML inferencing<br>                                                  pipeline.</li><br><br>                                            </ul><br></li><br><br>                                    </ol> |
| **Preprocessing** | **Preprocessing** |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimlvconverter.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_xsf_q5l_vbc"><br>                                        <li class="li">Receives the video stream on its sink pad.</li><br><br>                                        <li class="li">Performs preprocessing:<ul class="ul" id="single-camera-stream-with-image-classification-and-display__ul_ff2_twl_vbc"><br>                                                <li class="li">Color conversion</li><br><br>                                                <li class="li">Scaling down/up</li><br><br>                                                <li class="li">Normalization on the stream data when the model<br>                                                  expects the floating point values as an input</li><br><br>                                            </ul><br></li><br><br>                                        <li class="li">Converts the video stream to a tensor stream on its<br>                                            source pad.<p class="p">The classification model uses this tensor<br>                                                stream for inferencing.</p><br></li><br><br>                                    </ol> |
| **Inferencing** | **Inferencing** |
| [qtimltflite](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimltflite.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_bwn_s5l_vbc"><br>                                        <li class="li">Loads the model.</li><br><br>                                        <li class="li">Modifies the graph for the chosen delegate.</li><br><br>                                        <li class="li">Receives the tensor stream on its sinkpad.</li><br><br>                                        <li class="li">Runs the inference and produces a tensor stream with the<br>                                            inference results on its source pad.</li><br><br>                                    </ol> |
| **Postprocessing** | **Postprocessing** |
| qtimlpostprocess | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_gr1_w5l_vbc"><br>                                        <li class="li">Receives the inference tensors from a classification<br>                                            model on its sinkpad.</li><br><br>                                        <li class="li">Converts the tensors into formats such as video or text<br>                                            that the multimedia plugins can process later. </li><br><br>                                        <li class="li">Applies the threshold to the chosen number of<br>                                            results.</li><br><br>                                        <li class="li">Loads the corresponding modules of the classification<br>                                            models. <p class="p">In this use case, qtimlpostprocess does the<br>                                                following:</p><ol class="ol" type="a" id="single-camera-stream-with-image-classification-and-display__ol_rrb_1xl_vbc"><br>                                                <li class="li">Loads the submodule of the model.</li><br><br>                                                <li class="li">Produces results as structures of text.</li><br><br>                                                <li class="li">Sends them to the sinkpad of qtimetamux.</li><br><br>                                            </ol><br></li><br><br>                                    </ol> |
| [qtimetamux](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimetamux.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_ll3_x5l_vbc"><br>                                        <li class="li">Receives the video stream and text stream with<br>                                            classification results corresponding to the video stream<br>                                            on its sinkpads.</li><br><br>                                        <li class="li">Produces GST buffers with the contents of video stream<br>                                            on its sink pad.</li><br><br>                                        <li class="li">Adds classification result from data sinkpad to GST<br>                                            buffer meta (meta muxing) on its source pad.</li><br><br>                                    </ol> |
| [qtivoverlay](https://docs.qualcomm.com/doc/80-70023-50/topic/qtioverlay.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_wst_y5l_vbc"><br>                                        <li class="li">Receives the multiplexed stream.</li><br><br>                                        <li class="li">Overlays the classification labels on the VideoFrame<br>                                            using CL. </li><br><br>                                        <li class="li">Produces GST buffers with overlays in its source<br>                                            pad.</li><br><br>                                    </ol> |
| **Output** | **Output** |
| [Waylandsink](https://docs.qualcomm.com/doc/80-70023-50/topic/waylandsink.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_wx3_3lh_tfc"><br>                                        <li class="li">Receives the video stream on its sinkpad.</li><br><br>                                        <li class="li">Submits the video stream to Weston. </li><br><br>                                        <li class="li">Weston renders the video stream and possible<br>                                            classifications generated for that scene on a local<br>                                            display device.</li><br><br>                                    </ol> |

## Use qtivcomposer to mix original frame with classification mask

Run this use case on the target
                device:

    gst-launch-1.0 -e --gst-debug=2 qtiqmmfsrc name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! \
    tee name=split split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<480, 480>" ! queue ! waylandsink fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/inception_v3_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 40.0}" results=2 module=mobilenet-softmax labels=/etc/labels/classification.json ! \
    video/x-raw,format=BGRA,width=640,height=480 ! queue ! mixer.Copy to clipboard

To stop the use case, select 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. Compose classification labels and video stream using qtivcomposer.
3. Display the results.

Figure : Pipeline for classification with qtivcomposer
                
                <!--?xml version="1.0" encoding="UTF-8"?-->
<svg xmlns="http://www.w3.org/2000/svg" width="755" height="349.974590301513672" viewbox="0 0 755 349.974590301513672">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".499797821044922" width="754" height="348.974609375" rx="7.499999999999944" ry="7.499999999999944" style="fill: #fafafa;"></rect>
      <path d="M747,1c3.85980224609375,0,7,3.140201568603516,7,7v333.974590301513672c0,3.85980224609375-3.14019775390625,7-7,7H8c-3.85980224609375,0-7-3.14019775390625-7-7V8c0-3.859798431396484,3.14019775390625-7,7-7h739M747,0H8C3.581695556640625,0,0,3.581701278686523,0,8v333.974590301513672c0,4.418304443359375,3.581695556640625,8,8,8h739c4.41827392578125,0,8-3.581695556640625,8-8V8c0-4.418298721313477-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(565.4921875 326.066097259521484)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="545.241151182821341" y="313.974590301513672" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(664.073974609375 326.066097259521484)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="643.822932595674501" y="313.974590301513672" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="20" y="20.000014873722648" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429729461669922 48.506718635559082)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
      <g>
        <line x1="180" y1="45.000011444091797" x2="199.976654052734375" y2="45.000011444091797" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.955352783203125 48.490444183349609 205 45.000011444091797 198.955352783203125 41.50958251953125 198.955352783203125 48.490444183349609"></polygon>
      </g>
      <g>
        <line x1="285" y1="68.974590301513672" x2="285" y2="88.951229095458984" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="281.50958251953125 87.929935455322266 285 93.974590301513672 288.49041748046875 87.929935455322266 281.50958251953125 87.929935455322266"></polygon>
      </g>
      <g>
        <rect x="205" y="20.000014873722648" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(273.910202026367188 48.506718635559082)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">tee</tspan></text>
      </g>
      <g>
        <rect x="205" y="93.97459047333632" width="160" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(229.527496337890625 123.650547027587891)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtimlvconverter</tspan></text>
      </g>
      <g>
        <line x1="285" y1="143.974590301513672" x2="285" y2="163.951229095458984" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="281.50958251953125 162.929943084716797 285 168.974590301513672 288.49041748046875 162.929943084716797 281.50958251953125 162.929943084716797"></polygon>
      </g>
      <g>
        <rect x="205" y="168.97459047333632" width="160" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(250.820465087890625 198.650554656982422)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtimltflite</tspan></text>
      </g>
      <g>
        <line x1="285" y1="218.974590301513672" x2="285" y2="238.951244354248047" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="281.50958251953125 237.929943084716797 285 243.974590301513672 288.49041748046875 237.929943084716797 281.50958251953125 237.929943084716797"></polygon>
      </g>
      <g>
        <rect x="205" y="243.97459047333632" width="160" height="49.999999999999091" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(222.722808837890625 273.650554656982422)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtimlpostprocess</tspan></text>
      </g>
      <g>
        <line x1="365" y1="45.000011444091797" x2="384.97662353515625" y2="45.000011444091797" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.955322265625 48.490444183349609 390 45.000011444091797 383.955322265625 41.50958251953125 383.955322265625 48.490444183349609"></polygon>
      </g>
      <g>
        <rect x="390" y="20.000014873722648" width="160" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(421.140655517578125 48.506718635559082)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtivcomposer</tspan></text>
      </g>
      <g>
        <line x1="550" y1="45.000011444091797" x2="569.97662353515625" y2="45.000011444091797" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="568.955322265625 48.490444183349609 575 45.000011444091797 568.955322265625 41.50958251953125 568.955322265625 48.490444183349609"></polygon>
      </g>
      <g>
        <rect x="575" y="20.000014873722648" width="160" height="50" rx="4.000000000000019" ry="4.000000000000019" style="fill: #007884;"></rect>
        <text transform="translate(611.09771728515625 48.506718635559082)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
    </g>
    <g>
      <polyline points="365 268.974590301513672 470 268.974590301513672 470 75.847972869873047" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></polyline>
      <polygon points="473.49041748046875 76.869258880615234 470 70.824611663818359 466.50958251953125 76.869258880615234 473.49041748046875 76.869258880615234"></polygon>
    </g>
  </g>
</svg>

The following table provides the sequential processing stages of the pipeline
                execution:

| Process | Description |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70023-50/topic/qtiqmmfsrc.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_i4m_xlh_tfc"><br>                                    <li class="li">Collects the video stream (source) and creates two copies of<br>                                        the source:<ul class="ul" id="single-camera-stream-with-image-classification-and-display__ul_n44_nwl_vbc"><br>                                            <li class="li">One stream is sent to the qtivcomposer plugin to<br>                                                retain the video stream.</li><br><br>                                            <li class="li">The other stream is sent to the ML inferencing<br>                                                branch in the pipeline.</li><br><br>                                        </ul><br></li><br><br>                                </ol> |
| **Preprocessing** | **Preprocessing** |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimlvconverter.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_i5w_4wl_vbc"><br>                                    <li class="li">Receives the video stream on its sink pad.</li><br><br>                                    <li class="li">Performs preprocessing:<ul class="ul" id="single-camera-stream-with-image-classification-and-display__ol_zdw_qwl_vbc"><br>                                            <li class="li">Color conversion</li><br><br>                                            <li class="li">Scaling down/up</li><br><br>                                            <li class="li">Normalization on the stream data when the model<br>                                                expects the floating point values as an input</li><br><br>                                        </ul><br></li><br><br>                                    <li class="li">Converts the video stream to a tensor stream on its source<br>                                            pad.<p class="p">The classification model uses this tensor stream<br>                                            for inferencing.</p><br></li><br><br>                                </ol> |
| **Inferencing** | **Inferencing** |
| [qtimltflite](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimltflite.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_u1l_cxl_vbc"><br>                                    <li class="li">Loads the model.</li><br><br>                                    <li class="li">Modifies the graph for the chosen delegate.</li><br><br>                                    <li class="li">Receives the tensor stream on its sinkpad.</li><br><br>                                    <li class="li">Runs the inference and produces a tensor stream with the<br>                                        inference results on its source pad.</li><br><br>                                </ol> |
| **Postprocessing** | **Postprocessing** |
| qtimlpostprocess | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_o3v_2xl_vbc"><br>                                    <li class="li">Receives the inference results from a classification model<br>                                        on its sinkpad. </li><br><br>                                    <li class="li">Converts the inference tensors into formats like video or<br>                                        text that the multimedia plugins can process later. </li><br><br>                                    <li class="li">Applies the threshold to the chosen number of results. </li><br><br>                                    <li class="li">Loads the corresponding modules for the classification<br>                                        models. <p class="p">In this use case, qtimlpostprocess does the<br>                                            following: </p><ol class="ol" type="a" id="single-camera-stream-with-image-classification-and-display__ol_p3v_2xl_vbc"><br>                                            <li class="li">Loads the submodule of the model.</li><br><br>                                            <li class="li">Produces results as video frames with classification<br>                                                labels.</li><br><br>                                            <li class="li">Sends them to the sinkpad of qtivcomposer.</li><br><br>                                        </ol><br></li><br><br>                                </ol> |
| [qtivcomposer](https://docs.qualcomm.com/doc/80-70023-50/topic/qtivcomposer.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_nmc_lxl_vbc"><br>                                    <li class="li">Receives the original video stream with classification<br>                                        results on its sinkpads. </li><br><br>                                    <li class="li">On its sourcepad, produces GST buffers with contents<br>                                        composed of video streams from its sinkpads.</li><br><br>                                </ol> |
| **Output** | **Output** |
| [Waylandsink](https://docs.qualcomm.com/doc/80-70023-50/topic/waylandsink.html) | <ol class="ol" id="single-camera-stream-with-image-classification-and-display__ol_cgt_mwl_vbc"><br>                                    <li class="li">Receives the video in its sinkpad</li><br><br>                                    <li class="li">Submits the video stream to Weston. </li><br><br>                                    <li class="li">Weston renders the video stream and possible classifications<br>                                        generated for that scene on a local display device.</li><br><br>                                </ol> |

**Parent Topic:** [LiteRT use cases](https://docs.qualcomm.com/doc/80-70023-50/topic/tensorflow-lite-use-cases.html)

Last Published: Mar 27, 2026

[Previous Topic
LiteRT use cases](https://docs.qualcomm.com/bundle/publicresource/80-70023-50/topics/tensorflow-lite-use-cases.md) [Next Topic
Image classification and encode with LiteRT](https://docs.qualcomm.com/bundle/publicresource/80-70023-50/topics/single-camera-stream-with-image-classification-and-encode.md)