# Object detection and classification
Source: [https://docs.qualcomm.com/doc/80-70015-50/topic/camera-ai-detection-overlay-composer-display.html](https://docs.qualcomm.com/doc/80-70015-50/topic/camera-ai-detection-overlay-composer-display.html)
The **gst-camera-two-stream-detection-and-classification-side-by-side.py** script
uses a YOLOv8 TFLite model to detect and classify objects in the scene displayed by the AI
overlay composer.
Table : Models used for detection and classification
| Purpose | TFLite model | Description |
| :--- | :--- | :--- |
| Object detection | YOLOv8 |
- Identify the object in a scene from a camera stream.
- Overlay the bounding boxes over the detected objects.
|
| Image classification | Resnet101 |
- Classify a scene from a camera stream.
- Overlay the classification labels on the screen.
|
## Use cases
1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70015-50/topic/python-sample-applications.html#python-sample-applications__section_gm5_s5j_bdc).
2. Run the detection and classification
script:
python3 /usr/bin/gst-camera-two-stream-detection-and-classification-side-by-side.pyCopy to clipboard
Table : Default directories for model and label files
| Model and label files | Directory |
| :--- | :--- |
| Detection model | /opt/data/YoloV8N\_Detection\_Quantized.tflite |
| Detection labels | /opt/data/yolov8n.labels |
| Classification model | /opt/data/Resnet101\_Quantized.tflite |
| Classification labels | /opt/data/resnet101.labels |
## Expected output
The images are shown side by side on the display.

## Pipeline flow
Figure : Pipeline for object detection and classification

| Process | Description |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70015-50/topic/qtiqmmfsrc.html) | Collects two video streams from the camera:
- Stream for detection is split using tee and sent to the
following:
- qtimetamux to retain the video stream.
- qtimlvconverter to convert the video stream to input
tensors for the detection inference.
- Stream for classification is split using tee and sent to the
following:
- qtimetamux to retain the video stream.
- qtimlvconverter to convert the video stream to input
tensors for the classification inference.
|
| **Preprocessing** | **Preprocessing** |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70015-50/topic/qtimlvconverter.html) |
- Receives the video stream on its sink pad.
- Performs preprocessing:
- Color conversion
- Scaling down/up
- Normalization on the stream data when the model
expects the floating point values as an input
- Converts the video stream to a tensor stream on its source
pad.The classification model uses this tensor stream
for inferencing.
|
| **Inferencing** | **Inferencing** |
| [qtimltflite](https://docs.qualcomm.com/doc/80-70015-50/topic/qtimltflite.html) |
- Loads the model.
- Modifies the graph for the chosen delegate.
- Receives the tensor stream on its sinkpad.
- Runs the inference and produces a tensor stream with the
inference results on its source pad.
|
| **Postprocessing** | **Postprocessing** |
| [qtimlvdetection](https://docs.qualcomm.com/doc/80-70015-50/topic/qtimlvdetection.html) |
- Receives the inference tensors from the object detection
model.
- Converts the inference tensors on its sinkpad into formats
such as video or text that the multimedia plugins can
process later.
- Applies the threshold to the chosen number of results.
- Loads the corresponding modules for detection models.
In
this use case, qtimlvdetection does the following:
- Loads the YOLOv8 submodule.
- Produces results as structures of text.
- Sends them to the sinkpad of qtimetamux.
|
| [qtimlvclassification](https://docs.qualcomm.com/doc/80-70015-50/topic/qtimlvclassification.html) |
- Receives the inference results from a classification model
on its sinkpad.
- Converts the inference tensors into formats such as video or
text that the multimedia plugins can process later.
- Applies the threshold to the chosen number of results.
- Loads the corresponding modules for the classification
models. In this use case, qtimlvclassification does the
following:
- Loads the submodule of the model.
- Produces results as video frames with classification
labels.
- Sends them to the sinkpad of qtivcomposer.
|
| [qtimetamux](https://docs.qualcomm.com/doc/80-70015-50/topic/qtimetamux.html) |
- Receives video stream and text stream with bounding box
results corresponding to the video stream on its
sinkpads.
- Produces GST buffers with contents of the video stream from
its sink pad.
- Adds bounding boxes as GstVideoRegionOfInterest from data
sinkpad to GST buffers meta (meta muxing) on its source
pad.
|
| [qtioverlay](https://docs.qualcomm.com/doc/80-70015-50/topic/qtioverlay.html) |
- Receives the multiplexed stream.
- Overlays the bounding boxes on the VideoFrame using CL.
- Produces GST buffers with overlays in its source pad.
|
| [qtivcomposer](https://docs.qualcomm.com/doc/80-70015-50/topic/qtivcomposer.html) |
- Receives the original video stream with classification
results on its sinkpads.
- On its sourcepad, produces GST buffers with contents
composed of video streams from its sinkpads.
|
| **Output** | **Output** |
| [Waylandsink](https://docs.qualcomm.com/doc/80-70015-50/topic/waylandsink.html) |
- Receives the video in its sinkpad
- Submits the video stream to Weston.
- Weston renders the video stream on a local display
device.
|
**Parent Topic:** [Python sample applications](https://docs.qualcomm.com/doc/80-70015-50/topic/python-sample-applications.html)
Last Published: Oct 27, 2025
[Previous Topic
Decode and object detection](https://docs.qualcomm.com/bundle/publicresource/80-70015-50/topics/decode-detection-display.md) [Next Topic
Transform and encode a camera stream](https://docs.qualcomm.com/bundle/publicresource/80-70015-50/topics/camera-transform-downscale-and-rotate-encode.md)