# Object detection 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, USB source, or an RTSP stream, preprocesses it, runs inferences on AI hardware. The results are either displayed on the screen, saved as an encoded MP4 file, or streamed over the RTSP server. For information about the plugins used in the pipeline flow, see [Pipeline flow](https://docs.qualcomm.com/doc/80-80021-50/topic/gst-ai-object-detection.html#section-p2w-33y-kbc). Qualcomm Open source File (default) Camera (optional) tee qtdemux h264parse V4l2h264dec qtimlvconverter qtimltflite/qtimlsnpe/ qtimlqnn qtimlpostprocess sink_1 sink_0 filesrc qtimlvconverter qtimltflite/qtimlsnpe/ qtimlqnn qtimlpostprocess sink_1 sink_0 qtiqmmfsrc RTSP (optional) sink_0 rtph264 depay h264parse V4l2h264dec tee qtimlvconverter qtimltflite/qtimlsnpe/ qtimlqnn qtimlpostprocess sink_1 rtspsrc USB camera (Optional) tee qtimlvconverter qtimltflite/qtimlsnpe/ qtimlqnn qtimlpostprocess sink_1 sink_0 v4l2src_caps v4l2src qtivcomposer or or Waylandsink qtirtspbin filesink **Figure : gst-ai-object-detection pipeline** ## Input and output capabilities The following table summarizes the input and output capabilities supported by the sample application: | Config | Input | Input | Input | Input | Output | Output | Output | | --- | --- | --- | --- | --- | --- | --- | --- | | Config | File src | RTSP | USB camera | MIPI camera | File | Display | RTSP | | Config #1 | Yes | Yes | No | No | No | Yes | Yes | | Config #2 | Yes | Yes | No | Yes | Yes | Yes | Yes | | | | | | | | | | ## Sample model and label files | Runtime | Model files | Label files | | --- | --- | --- | | Qualcomm Neural Processing SDK | *yolonas.dlc* | | | LiteRT | *yolov8\_det\_quantized.tflite*


*yolox\_quantized.tflite* | | | Qualcomm AI Engine direct | *yolov8\_det\_quantized.bin* | | | | | | | | | | ## 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-80021-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-80021-50/topic/gst-ai-object-detection.html#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": "