# Object detection, classification, and segmentation
Source: [https://docs.qualcomm.com/doc/80-70015-50/topic/object-detection-classification-and-segmentation-python-sample-app.html](https://docs.qualcomm.com/doc/80-70015-50/topic/object-detection-classification-and-segmentation-python-sample-app.html)
The **gst-filesrc-2detection-classification-segmentation-side-by-side.py** script
identifies an object from a scene in a camera stream, overlays the bounding boxes over the
detected objects, classifies scenes from the video stream, and produces semantic
segmentations for the video. The output is displayed side by side on a screen.
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.
|
| Image segmentation | FFNet40S | Produce semantic segmentations for the video file. |
## 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, classification, and segmentation
script:
python3 /usr/bin/gst-filesrc-2detection-classification-segmentation-side-by-side.pyCopy to clipboard
The following are the input videos:
| Input video | Directory |
| --- | --- |
| Object detection | /opt/data/Draw\_720p\_180s\_30FPS.mp4 |
| Image classification | /opt/data/Animals\_000\_720p\_180s\_30FPS.mp4 |
| Image segmentation | /opt/data/Street\_Bridge\_720p\_180s\_30FPS.MOV |
The following are the default file paths in the Python script.
Table : Default directories for model and label files
| Model and label files | Directory |
| :--- | :--- |
| Detection model |
- /opt/data/YoloV8N_Detection_Quantized.tflite
- /opt/data/yolov7_quantized.tflite
|
| Detection labels | /opt/data/yolov8n.labels |
| Classification model | /opt/data/Resnet101\_Quantized.tflite |
| Classification labels | /opt/data/resnet101.labels |
| Segmentation model | /opt/data/ffnet\_40s\_quantized.tflite |
| Segmentation labels | /opt/data/dv3-argmax.labels |
## Expected output
The four streams are previewed side by side on a local display.
## Pipeline flow
Figure : Pipeline for object detection, image classification, and segmentation

| Process | Description |
| --- | --- |
| filesrc | Reads the video data from a file. |
| qtdemux | Demultiplexes the video data. |
| h264parse | Parses the H.264 video. |
| [v4l2h264dec](https://docs.qualcomm.com/doc/80-70015-50/topic/v4l2h264dec.html) | Decodes the H.264 video. |
| **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 object detection, classification, and
segmentation models use 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 like 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.
|
| [qtimlvsegmentation](https://docs.qualcomm.com/doc/80-70015-50/topic/qtimlvsegmentation.html) |
- Receives the inference tensors on its sinkpad.
- Converts the inference tensors into video formats that the
multimedia plugins can process later.
- Produces the semantic segmentations for the frame.
- Loads the corresponding modules for the segmentation
models.In this use case, qtimlvsegmentation does the
following:
- Loads the deeplab-argmax submodule.
- Produces video frames with segmentation masks.
- 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
Camera encode, object detection, and display](https://docs.qualcomm.com/bundle/publicresource/80-70015-50/topics/camera-encode-file-detection-yolov8-overlay-display.md) [Next Topic
GStreamer command-line use cases](https://docs.qualcomm.com/bundle/publicresource/80-70015-50/topics/gstreamer-application-use-cases.md)