# Object detection, classification, and segmentation 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 segmentation for the video. The output is displayed side by side on a screen. Note This application isn't supported in the QLI 2.0 RC2 release because the Python bindings aren't enabled. **Figure : Pipeline for object detection, image classification, and segmentation** For information about the plugins used in this pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-80021-50/topic/object-detection-classification-and-segmentation-python-sample-app.html#section-mty-hyk-bdc). ## Model files Table : Models used for detection and classification | Purpose | LiteRT model | Description | | --- | --- | --- | | Object detection | YOLOX |

  1. Identify the object in a scene from a camera stream.


  2. Overlay the bounding boxes over the detected objects.


| | Image classification | InceptionV3 |

  1. Classify a scene from a camera stream.


  2. Overlay the classification labels on the screen.


| | Image segmentation | Deeplab\_plus\_mobilenet | Produce semantic segmentations for the video file. | ## Run the application on the target device 1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-80021-50/topic/prerequisites-for-python-sample-applications.html). 2. Run the detection, classification, and segmentation script on the target device: gst-filesrc-2detection-classification-segmentation-side-by-side.py Copy to clipboard 3. To display the available help options, run the following command: gst-filesrc-2detection-classification-segmentation-side-by-side.py -h Copy to clipboard The following are the input videos: | Input video | Directory | | --- | --- | | Object detection | `/etc/media/video.mp4` | | Image classification | `/etc/media/video.mp4` | | Image segmentation | `/etc/media/video.mp4` | The default file paths in the Python script are as follows: Table : Default directories for model and label files | Model and label files | Directory | | --- | --- | | Detection model | `/etc/models/yolox_quantized.tflite` | | Detection labels | `/etc/labels/yolox.json` | | Classification model | `/etc/models/inception_v3_quantized.tflite` | | Classification labels | `/etc/labels/classification.json` | | Segmentation model | `/etc/models/deeplabv3_plus_mobilenet_quantized.tflite` | | Segmentation labels | `/etc/labels/deeplabv3_resnet50.json` | ## Expected output The four streams can be previewed side by side on a local display. ## Pipeline flow | **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-80021-50/topic/v4l2h264dec.html) | Decodes the H.264 video. | | **Preprocessing** | **Preprocessing** | | [qtimlvconverter](https://docs.qualcomm.com/doc/80-80021-50/topic/qtimlvconverter.html) |

  1. Receives the video stream on its sink pad.


  2. Performs preprocessing:



  1. 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-80021-50/topic/qtimltflite.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](https://docs.qualcomm.com/doc/80-80021-50/topic/qtimlpostprocess.html) |

  1. Receives the inference tensors from the object detection model.


  2. Converts the inference tensors on its sinkpad 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 for detection models.




In this use case, qtimlpostprocess does the following:



>
>
>

    >
  1. Loads the YOLOv8 submodule.


  2. >
  3. Produces results as structures of text.


  4. >
  5. Sends them to the sinkpad of qtimetamux.


  6. >
| | [qtimlpostprocess](https://docs.qualcomm.com/doc/80-80021-50/topic/qtimlpostprocess.html) |

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


  2. Converts the inference tensors into formats like 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 for the classification models.




In this use case, qtimlpostprocess does the following:



>
>
>

    >
  1. Loads the submodule of the model.


  2. >
  3. Produces results as video frames with classification labels.


  4. >
  5. Sends them to the sinkpad of qtivcomposer.


  6. >
| | [qtimlpostprocess](https://docs.qualcomm.com/doc/80-80021-50/topic/qtimlpostprocess.html) |

  1. Receives the inference tensors on its sinkpad.


  2. Converts the inference tensors into video formats that the multimedia plugins can process later.


  3. Produces the semantic segmentations for the frame.


  4. Loads the corresponding modules for the segmentation models.




In this use case, qtimlpostprocess does the following:



>
>
>

    >
  1. Loads the deeplab-argmax submodule.


  2. >
  3. Produces video frames with segmentation masks.


  4. >
  5. Sends them to the sinkpad of qtivcomposer.


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

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


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


  3. Adds bounding boxes as GstVideoRegionOfInterest from data sinkpad to GST buffers meta (meta muxing) on its source pad.


| | [qtivoverlay](https://docs.qualcomm.com/doc/80-80021-50/topic/qtioverlay.html) | 1. Receives the multiplexed stream.
1. Overlays the bounding boxes on the VideoFrame using CL.
2. Produces GST buffers with overlays in its source pad. | | [qtivcomposer](https://docs.qualcomm.com/doc/80-80021-50/topic/qtivcomposer.html) | 1. Receives the original video stream with classification results on its sinkpads.
1. On its sourcepad, produces GST buffers with contents composed of video streams from its sinkpads. | | **Output** | **Output** | | [Waylandsink](https://docs.qualcomm.com/doc/80-80021-50/topic/waylandsink.html) | 1. Receives the video in its sinkpad
1. Submits the video stream to Weston.
2. Weston renders the video stream on a local display device. | | | | | | | ## Related information - [Object detection](https://docs.qualcomm.com/doc/80-80021-50/topic/gst-ai-object-detection.html) - [Image classification](https://docs.qualcomm.com/doc/80-80021-50/topic/gst-ai-classification.html) - [Image segmentation](https://docs.qualcomm.com/doc/80-80021-50/topic/gst-ai-segmentation.html) Last Published: Mar 26, 2026 [Previous Topic Camera encode, object detection, and display](https://docs.qualcomm.com/bundle/publicresource/80-80021-50/topics/camera-encode-file-detection-yolov8-overlay-display.md) [Next Topic Parallel inference using Python](https://docs.qualcomm.com/bundle/publicresource/80-80021-50/topics/parallel-inference-using-python.md) Source: [https://docs.qualcomm.com/doc/80-80021-50/topic/object-detection-classification-and-segmentation-python-sample-app.html](https://docs.qualcomm.com/doc/80-80021-50/topic/object-detection-classification-and-segmentation-python-sample-app.html)