Skip to main content
This section covers Python-based AI sample applications that demonstrate vision and multi-model inference on Qualcomm platforms. The following tables list all available Python AI applications and their platform support. Select the appropriate configuration tab for your setup.
None of the Python AI applications are supported in Config #1 of the QLI 2.1 GA release. Select the Config #2 tab.

Prerequisites

Some of the steps in the pre-requisties will be removed from future releases once the necessary fixes are mainlined.
1

Set up Wi-Fi

Connect to the Wireless Access Point (Wi-Fi Router):
Check the connection and device status:
Login to the target deviceLocate the IP address of the device according to the type of network connection, using the device shell on the Linux host:
Use the IP address from the Linux host to establish an SSH connection to the device:
Example:
Connect to the SSH shell using the following password:
2

Download Models and Artifacts

On the target device, obtain the download_artifacts.sh script, set executable permissions, and run it to download the model, media, and label files:
On Qualcomm Ubuntu, run the above command with sudo.
3

Enable qticamsrc

In the terminal of the target device, run the following command to enable the qticamsrc on Config #2:
4

Enable Audio and GPU Delegate

In the terminal of the target device, run the following command to enable audio:
To set the default devices for sink and source, get the device numbers from wpctl status and run the following command:
In the terminal of the target device, run the following command to enable the GPU delegate and backend:

AI Vision Applications

Object Detection and Display

The gst-ai-object-detection.py script receives an RTSP stream as a source, decodes it, uses YOLOv8 LiteRT model to identify the object in a scene from the camera stream and overlay the bounding boxes over the detected objects. The results are shown on the display. For information about the plugins used in this pipeline, see Pipeline flow.
This application isnโ€™t supported in Config #1 of Qualcomm Linux because CPU runtime is not supported.
Application: gst-ai-object-detection.py Pipeline Diagram

Sample Model and Label Files

Run the application on the target device

1

Download artifacts

Ensure that you complete the Prerequisites. This downloads all required artifacts to the target device.
2

Run the application

Run any of the following use cases:
  • Display with the primary and secondary cameras respectively:
  • Display with input from a video file:
  • YOLOv8 with LiteRT:
Both yolox_quantized.tflite and yolov8_det_w8a8.tflite model files use the Yolov8 module.
To display all available options:
To stop the use case, press CTRL + C.

Expected Output

Detected objects with bounding boxes and labels are overlaid on the video and displayed on the local display.Output Diagram

Pipeline Flow

The following table lists the plugins used in the object detection pipeline:

Decode and Object Detection Using RTSP Stream

The gst-rtspsrc-detection-display.py script receives an RTSP stream as a source, decodes it, uses YOLOv8 LiteRT model to identify the object in a scene from the camera stream and overlay the bounding boxes over the detected objects. The results are shown on the display. For information about the plugins used in this pipeline, see Pipeline flow.
This application isnโ€™t supported in Config #1 of Qualcomm Linux because CPU runtime is not supported.
Application: gst-rtspsrc-detection-display.py Pipeline Diagram

Sample Model and Label Files

Run the application on the target device

1

Download artifacts

Ensure that you complete the Prerequisites. This downloads all required artifacts to the target device.
2

Run the application

Run the object detection script on the target device:Console 1 โ€” start the RTSP server:
Console 2 โ€” run the detection script:
To display all available options:
The default paths for model and label files are provided in the help section.
To stop the use case, press CTRL + C.

Expected Output

Output Diagram

Pipeline Flow

The following table lists the plugins used in the rtsp detection pipeline:

Object Detection and Classification

The gst-camera-two-stream-detection-and-classification-side-by-side.py application uses a YOLOX LiteRT model to detect and inception_v3 to classify objects in the scene displayed by the AI overlay composer. For information about the plugins used in this pipeline, see Pipeline flow.
This application isnโ€™t supported in Config #1 of Qualcomm Linux because CPU runtime is not supported.
Application: gst-camera-two-stream-detection-and-classification-side-by-side.py Pipeline Diagram

Sample Model and Label Files

Run the application on the target device

1

Download artifacts

Ensure that you complete the Prerequisites. This downloads all required artifacts to the target device.
2

Run the application

To display all available options:
The default paths for model and label files are provided in the help section.
To stop the use case, press CTRL + C.

Expected Output

Detection and classification display are shown side-by-side.Pipeline Diagram

Pipeline Flow

The following table lists the plugins used in the detection and classification pipeline:

Known Issues

Output labels are blurred.

Object Detection, Classification, and Segmentation

The gst-filesrc-2detection-classification-segmentation-side-by-side.py script identifies objects, classifies scenes, and produces semantic segmentation from a video file. The output is displayed side by side. For information about the plugins used in this pipeline, see Pipeline flow.
This application isnโ€™t supported in Config #1 of Qualcomm Linux because CPU runtime is not supported.
Application: gst-filesrc-2detection-classification-segmentation-side-by-side.py Pipeline Diagram

Sample Model and Label Files

Run the application on the target device

1

Download artifacts

Ensure that you complete the Prerequisites. This downloads all required artifacts to the target device.
2

Run the application

The default input video for classification, segmentation, and detection is at $/Downloads/qimsdk_samples/media/video.mp4`.
To display all available options:
The default paths for model and label files are provided in the help section.
To stop the use case, press CTRL + C.

Expected Output

The four streams are previewed side by side on a local display.

Pipeline Flow

The following table lists the plugins used in the detection, classification and segmentation pipeline:

Camera Encode, Object Detection, and Display

The gst-camera-two-stream-encode-file-detection-display.py application encodes the camera stream to a file while simultaneously running YOLOX object detection and displaying results. For information about the plugins used in this pipeline, see Pipeline flow.
This application isnโ€™t supported in Config #1 of Qualcomm Linux because CPU runtime is not supported.
Application: gst-camera-two-stream-encode-file-detection-display.py Pipeline Diagram

Sample Model and Label Files

Run the application on the target device

1

Download artifacts

Ensure that you complete the Prerequisites. This downloads all required artifacts to the target device.
2

Run the application

To display all available options:
The default paths for model and label files are provided in the help section.
To stop the use case, press CTRL + C.

Expected Output

The camera encode output is saved at ${HOME}/Downloads/qimsdk_samples/media/test.mp4.The object detection output is rendered on the display.Pipeline Diagram

Pipeline Flow

The following table lists the plugins used in the camera encode detection pipeline:

Parallel Inference Using Python

The gst-parallel-inference.py application receives a video input from a camera, file, or RTSP stream and runs four-channel parallel AI inference (classification, object detection, pose detection, and segmentation). For information about the plugins used in this pipeline, see Pipeline flow.
This application isnโ€™t supported in Config #1 of Qualcomm Linux because CPU runtime is not supported.
Application: gst-parallel-inference.py Pipeline Diagram

Sample Model and Label Files

Run the application on the target device

1

Download artifacts

Ensure that you complete the Prerequisites. This downloads all required artifacts to the target device.
2

Run the application

  • Input from the camera:
  • Input from a file:
  • Input from an RTSP stream:
To display all available options:
The default paths for model and label files are provided in the help section.
To stop the use case, press CTRL + C.

Expected Output

The four inference results are displayed side by side on the screen.Expected Output

Pipeline Flow

The following table lists the plugins used in the parallel inference pipeline:

Daisy Chain Detection and Pose Detection Using Python

The gst-ai-daisychain-detection-pose.py application performs cascaded object detection and pose detection with input from a camera, file, or RTSP stream. For information about the plugins used in this pipeline, see Pipeline flow.
This application isnโ€™t supported in Config #1 of Qualcomm Linux because CPU runtime is not supported.
Application: gst-ai-daisychain-detection-pose.py Pipeline Diagram

Sample Model and Label Files

Run the application on the target device

1

Download artifacts

Ensure that you complete the Prerequisites. This downloads all required artifacts to the target device.
2

Run the application

  • Input from the camera:
  • Input from a file:
  • Input from an RTSP stream:
To display all available options:
The default paths for model and label files are provided in the help section.
To stop the use case, press CTRL + C.

Expected Output

Expected Output

Pipeline Flow

The following table lists the plugins used in the daisychain detection and pose pipeline:

Troubleshooting

If any model isnโ€™t available after downloading the script file, you can download the model manually from IoT โ€” Qualcomm AI Hub and push it to the target device:
For example:
Remount the file system with read/write permissions:For Qualcomm Linux:
If you cannot locate the qticamsrc plugin, ensure that the camera server is running and clear the GStreamer cache using the following commands:
To enable basic GStreamer logging, run the following before launching the application:
To increase verbosity for specific plugins, use a comma-separated list with log levels (1โ€“7):
To redirect logs to a file for offline analysis: