# Object detection, classification, and segmentation
Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/object-detection-classification-and-segmentation-python-sample-app.html](https://docs.qualcomm.com/doc/80-70022-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
segmentation for the video. The output is displayed side by side on a screen.
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-70022-50/topic/object-detection-classification-and-segmentation-python-sample-app.html#object-detection-classification-and-segmentation-python-sample-app__section_mty_hyk_bdc).
## Model files
Table : Models used for detection and classification
| Purpose | LiteRT model | Description |
| :--- | :--- | :--- |
| Object detection | YOLOX |
Identify the object in a scene from a camera stream.
Overlay the bounding boxes over the detected objects.
|
| Image classification | InceptionV3 |
Classify a scene from a camera stream.
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-70022-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.pyCopy to clipboard
3. To display the available help options, run the following
command:
gst-filesrc-2detection-classification-segmentation-side-by-side.py -hCopy 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-70022-50/topic/v4l2h264dec.html) | Decodes the H.264 video. |
| **Preprocessing** | **Preprocessing** |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70022-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.