Skip to main content
The gst-ai-classification sample application demonstrates hardware-accelerated image classification on a video stream. The pipeline receives input from a camera, file source, Real-Time Streaming Protocol (RTSP) stream or USB camera, performs preprocessing, runs inference on the AI hardware, and displays the results on screen. gst-ai-classification pipeline diagram The gst-ai-classification application is part of the Qualcomm Intelligent Multimedia (QIM) SDK and is available on the device after flashing. You must push the model and label files to the device before running the application.

Download model and label files

1

Enable Wi-Fi and SSH on the device

The device requires an internet connection to download the artifacts needed to run sample applications. If SSH and Wi-Fi are already configured, skip this step.Follow Setup an SSH connection to enable Wi-Fi and SSH on the device.
2

Set the user environment variable on the host computer

3

Sign in to the target device using SSH

4

Download and run the download_artifacts_2.x.sh script

5

Enable qticamsrc

In the terminal of the target device, run the following command to enable camera:
camera use-case is not supported on IQ-2390.
6

(Optional) Download the YOLOv8 model

Use one of the following methods:
1

Create a Qualcomm AI Hub account

2

Copy your API key

Go to Settings in the upper right corner and copy your API key.
3

Run the export script on the host computer

Replace <API_KEY> with your API key:
The models are downloaded to the export_assets directory.
4

Copy the model to the ${HOME}/Downloads/qimsdk_samples/models/ directory on the device

Run the sample application

1

On the host computer, set the user environment variable

2

Sign in to the device using SSH

3

Run the application with the sample configuration file

To run the application with the sample configuration file, use:
This command runs the application using the sample configuration in /etc/configs/config_classification.json.To view the available command-line options, run:
Press CTRL + C to stop the execution.
4

Run the application with a custom configuration file (optional)

You can use a custom configuration file by specifying its path with --config-file:
If --config-file is specified, the application uses that file. Otherwise, it searches for config_classification.json in the following order:To create a user-specific configuration, copy the sample file to the user configuration directory:
Modify the copied configuration file to specify the required parameters. The custom configuration file must follow the schema defined in configurations.
Run the application:
The application overlays classified object labels and confidence scores on the video stream and displays the results on the configured output. To stop the application, press Ctrl+C.

Configure the application

Edit the config_classification.json file to specify your model, input source, and output preferences. Configuration template
Example configuration — LiteRT model on a video file using the DSP runtime:
This section uses the following default file locations:
  • ${HOME}/Downloads/qimsdk_samples/models/ — model files
  • ${HOME}/Downloads/qimsdk_samples/labels/ — label files
  • ${HOME}/Downloads/qimsdk_samples/media/ — video files
JSON configuration field descriptions

Notes

  • To stop the application, press Ctrl+C.
  • To enable GStreamer debug logging, set the GST_DEBUG environment variable. For example, to log all warnings:
    For more troubleshooting options, see Troubleshooting.