# Object detection
Source: [https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-object-detection.html](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-object-detection.html)
The **gst-ai-object-detection** application allows you to detect objects within
images and videos. The use cases show the execution of [YOLOv5](https://github.com/ultralytics/yolov5), [YOLOv8](https://github.com/ultralytics/ultralytics), and [YOLOX](https://github.com/Megvii-BaseDetection/YOLOX/blob/main/README.md) using the Qualcomm Neural Processing SDK runtime, YOLOv8
using Qualcomm AI Engine direct, and YOLOv5 and YOLOv8 using LiteRT.
The following figure shows the pipeline, which receives the input from a live camera
feed, file, or an RTSP stream, preprocesses it, runs inferences on AI hardware, and
displays the results on the screen. For information about the plugins used in the
pipeline flow, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-object-detection.html#gst-ai-object-detection__section_p2w_33y_kbc).
Figure : gst-ai-object-detection pipeline
## Sample model and label files
| Runtime | Model files | Label files |
| --- | --- | --- |
| Qualcomm Neural Processing SDK | *yolonas.dlc* |
yolonas.labels yolov8.labels yolox.labels |
| LiteRT | *yolov8\_det\_quantized.tflite* *yolox\_quantized.tflite* | yolonas.labels yolov8.labels yolox.labels |
| Qualcomm AI Engine direct | *yolov8\_det\_quantized.bin* | yolonas.labels yolov8.labels yolox.labels |
| | | |
| | | |
## Run the application on the target device
The sample application uses the
/etc/configs/config\_detection.json file to read the input
parameters.
To create your own config JSON file, use [config_detection.json](https://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/gst-plugins-qti-oss/-/blob/imsdk.lnx.2.0.0.r2-rel/gst-sample-apps/gst-ai-object-detection/config_detection.json?ref_type=heads) as a reference.
1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70020-50/topic/download-model-and-label-files.html).
2. Update the config JSON file based on the model, input stream, and other
properties. For more information, see [Config JSON field description](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-object-detection.html#gst-ai-object-detection__section_qjx_hqq_32c).
3. Use the following format of the
/etc/configs/config\_detection.json
file:
{
"file-path": " ",
"ml-framework": "",
"yolo-model-type": "",
"model": "",
"labels": "",
"constants": "",
"threshold": ,
"runtime": ""
}Copy to clipboard
For example, run the application using input from the video
file, LiteRT, YOLOx model, DSP runtime, custom constants, and custom
threshold value:
{
"file-path": "/etc/media/video.mp4",
"ml-framework": "tflite",
"yolo-model-type": "yolox",
"model": "/etc/models/yolox_quantized.tflite",
"labels": "/etc/labels/yolox.labels",
"constants": "YOLOx,q-offsets=<38.0, 0.0, 0.0>,q-scales=<3.6124823093414307, 0.003626860911026597, 1.0>;",
"threshold": 40,
"runtime": "dsp"
}Copy to clipboard
4. Run the gst-ai-object-detection application:
gst-ai-object-detection --config-file=/etc/configs/config_detection.jsonCopy to clipboard
Note: The
Yolo-NAS-Quantized.tflite model can be run
using the YOLOv8 value in the `yolo-model-type` field.
5. To display the available help options, run the following command in the SSH
shell:
gst-ai-object-detection -hCopy to clipboard
6. To display the available help options, run the following command in the SSH
shell:
gst-ai-object-detection -hCopy to clipboard
7. To stop the use case, use CTRL +
C.
## Expected output
Figure : Expected output for gst-ai-object-detection application

## Pipeline flow
The following table lists the plugins used in the object detection
pipeline:
| Plugin | Description |
| --- | --- |
| Camera source:[qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70020-50/topic/qtiqmmfsrc.html) | Captures the live stream from camera. Uses tee to split the stream for inferencing. |
| File source: filesrc | Captures the video stream using filesrc, followed by qtdemux, which demultiplexes the stream. Uses tee to split the stream for inferencing. |
| RTSP source: rtspsrc | Captures the RTSP stream using rtspsrc, followed by rtph264depay for video extraction. Uses tee to split the stream for inferencing. |
| h264parse | Parses the H.264 video. |
| [v4l2h264dec](https://docs.qualcomm.com/doc/80-70020-50/topic/v4l2h264dec.html) | Decodes the video. |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70020-50/topic/qtimlvconverter.html) | Receives the video stream on its sink pad. Performs the following preprocessing on the stream data. This preprocessing is done when the model expects floating-point values as input. Color conversion Scaling (up or down) Normalization Converts the preprocessed video stream to a tensor stream on its source pad. The tensor stream is used for inferencing in the later stages of the pipeline. |
| Inferencing plugins: | After the inference runtime receives the tensor stream on its sink pad, it runs the inference. Produces a tensor stream with the inference results on its source pad. |
| [qtimlvdetection](https://docs.qualcomm.com/doc/80-70020-50/topic/qtimlvdetection.html) | Handles inference results from any object detection model. Applies a threshold to the chosen number of results. Loads the YOLO (YOLOv5, YOLOv8, or YOLO-NAS) module. Produces video frames with only bounding boxes that can be overlaid on objects. Sends these processed frames to the sink pad of qtivcomposer. |
| [qtivcomposer](https://docs.qualcomm.com/doc/80-70020-50/topic/qtivcomposer.html) | Composes frames with contents from its sink pads. Pushes the GStreamer buffers containing these composed frames to its source pad. |
| [Waylandsink](https://docs.qualcomm.com/doc/80-70020-50/topic/waylandsink.html) | Waylandsink submits the video stream received on its sink pad to Weston. Weston renders the video stream on a local display. |
## Config JSON field description
The different parameters available to configure the JSON file and run the use case
are as follows:
Table : Field description–config_detection.json file
| Field | Values/description |
| :--- | :--- |
| **ml-framework** | Use one of the following models: snpe–Qualcomm Neural Processing SDK tflite–LiteRT qnn–Qualcomm AI Engine direct |
| **yolo-model-type** | Run the `yolov5`, `yolov8`, `yolox`, and `yolonas` models respectively. See [Sample model and label files](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-object-detection.html#gst-ai-object-detection__section_ohr_1qq_32c). |
| **runtime** | Use one of the following runtimes: |
| **Input source** | Use one of the following input sources: camera–Primary (0) or secondary (1). file-path–The directory path to the video file. rtsp-ip-port–The address of the RTSP stream: rtsp://<ip>:<port>/<stream> |
## Known issue
The Qualcomm AI Hub YOLOv8 AI Engine direct SDK models aren't supported. The models
will be updated in a future release.
## Related information
- [Object detection and display with LiteRT](https://docs.qualcomm.com/doc/80-70020-50/topic/single-camera-stream-with-object-detection-and-display.html)
- [Object detection and encode with LiteRT](https://docs.qualcomm.com/doc/80-70020-50/topic/single-camera-stream-with-object-detection-and-encode.html)
- [Object detection and display with Neural Processing SDK](https://docs.qualcomm.com/doc/80-70020-50/topic/single-camera-stream-with-object-detection-and-display-with-mobilenet-v2-ssd.html)
- [Object detection and encode with Neural Processing SDK](https://docs.qualcomm.com/doc/80-70020-50/topic/single-camera-stream-with-object-detection-and-encode-with-mobilenet-v2-ssd.html)
**Parent Topic:** [Run AI/ML sample applications](https://docs.qualcomm.com/doc/80-70020-50/topic/ai-ml-sample-applications.html)
Last Published: Jan 30, 2026
[Previous Topic
Image classification](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/gst-ai-classification.md) [Next Topic
Pose detection](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/gst-ai-pose-detection.md)