> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure sample applications

This section provides a flexible workflow for running and customizing advanced multimedia and AI sample applications using the Qualcomm® Intelligent Multimedia Product (QIMP) SDK on Ubuntu. Developers can define input/output sources, runtime targets, and model precision using JSON configuration files—enabling seamless evaluation across CPU, GPU, and DSP. With support for frameworks like TFLite, QNN, and SNPE, and integration with AI Hub, this setup is ideal for building and optimizing edge AI pipelines tailored to specific use cases.

Running advanced multimedia and AI sample applications using the **QIMP SDK** on Ubuntu enables developers to:

* **Prototype and validate AI workloads** across heterogeneous compute targets (CPU, GPU, DSP), helping teams choose the most efficient runtime for their use case.
* **Customize application behavior** using JSON-based configuration, allowing precise control over input/output sources, model types, and runtime parameters.
* **Accelerate development and deployment** by leveraging pre-integrated models from AI Hub and supported frameworks like TFLite, QNN, and SNPE.
* **Benchmark performance and optimize resource usage**, which is critical for embedded systems and edge devices where compute and power budgets are constrained.
* **Ensure compatibility and reproducibility** across Qualcomm platforms by using standardized scripts and directory structures for models, labels, and media assets.

To begin configuring sample applications on your Dragonwing device, follow these step-by-step instructions to install required dependencies and configure the system.

**Prerequisites**

* Setup the Device.
* Ensure that the IQ‑9075 device is running Ubuntu OS.
* Setup Wi-Fi & access IQ-9075 EVK device via SSH.
* Basic familiarity with **JSON configuration files** and runtime environment variables.
* **Access to AI Hub** for model selection and export.
  * [**Create AI Hub account**](https://aihub.qualcomm.com/)\*\* if you don't already have one\*\*
* If the PPA packages are not already installed, run the **Install needed packages** step.

## Install needed packages

To install the needed pre-built packages, refer to the [**🔗Install required software packages**](../devices/iq9075-evk/Install_required_software_packages) section and run the provided "Install PPA Packages" script.

## Download and run the artifact script

Before running any sample applications, you must download the required models, labels, and media assets. The `download_artifacts.sh` script automatically fetches all required components, including:

* Models – Pretrained machine‑learning models used by the sample applications for inference.
* Labels – Metadata files that map model outputs to human‑readable class names.
* Media files – Sample input data (such as images or videos) used to run and validate the applications.

You can run the following commands via SSH, or logged on locally to your device.

```shell theme={null}
cd /home/ubuntu 
curl -L -O https://raw.githubusercontent.com/quic/sample-apps-for-qualcomm-linux/refs/heads/main/qualcomm-linux/scripts/download_artifacts.sh
sudo chmod +x download_artifacts.sh 
sudo ./download_artifacts.sh
```

## Verify Model/Label/Media Files

Before launching any sample applications, make sure the required files are in place.

#### Check the following directories:

* **Model files** → `/etc/models/`
* **Label files** → `/etc/labels/`
* **Media files** → `/etc/media/`

<Note>
  **Note:**  These files are essential for AI sample applications to function correctly. If they’re missing, re-run the artifact download script.
</Note>

## Updating JSON Config File

To run sample applications with a specific functionality, you’ll need a properly configured JSON file.

### What to Do

* Update the required JSON config file based on your **model** and **config requirements**.

### Configuration Parameters

| parameter       | Option                                     |
| --------------- | ------------------------------------------ |
| Input Source    | Camera, File (Filesrc), RTSP Stream        |
| Output Source   | Waylandsink, Filesink, RTSP Stream         |
| Runtime Options | CPU, GPU, DSP                              |
| Precision       | INT8 or INT16, W8A8 or W8A16, FP32         |
| Model Type      | Select from available models in **AI Hub** |
| Labels          | Select the correct labels file             |

**Example 1:**\
The ***gst-ai-multistream-inference*** application shows AI inference (object detection and classification) on up to 32 input streams coming from camera, file, or RTSP streams.

To run the multistream inference sample application for object detection using 32 H.264 file inputs and display the output on a Wayland display, configure the input file paths to reference /etc/media/video.mp4 for all 32 streams. Open the corresponding `config-multistream-inference.json` file and apply the required changes.

```shell theme={null}
sudo vi /etc/configs/config-multistream-inference.json
```

```shell theme={null}
{
  "input-file-path":
    [
      "/etc/media/video.mp4",
      "/etc/media/video.mp4",
      "/etc/media/video.mp4",
      "/etc/media/video.mp4",
      .......
       "/etc/media/video.mp4",
    ]
}
```

**Example 2:**\
The `gst-ai-object-detection` application allows you to detect objects within images and videos. To consider the input source from a live camera feed, configure the input source as

```bash theme={null}
#Primary
"camera":0
#Secondary
"camera":1
```

## Run the sample application

To run the sample application, do the following:

1. Use the SSH or SBC terminal to launch the sample application.
2. Set the required environment variables to connect a Wayland application to the active user session.

```bash theme={null}
export XDG_RUNTIME_DIR=/run/user/$(id -u ubuntu)
export WAYLAND_DISPLAY=wayland-1
```

3. For Desktop build:\
   Run the following additional command to creates a missing symbolic link (for TensorFlow Lite C library).

```bash theme={null}
sudo ln -s /lib/aarch64-linux-gnu/libtensorflowlite_c.so.2 /lib/aarch64-linux-gnu/libtensorflowlite_c.so
```

4. Run sample application.\\

```shell theme={null}
gst-ai-multistream-inference
```

**gst-ai-multistream-inference pipeline:**

<img src="https://mintlify.s3.us-west-1.amazonaws.com/qualcomm-prod/images/run-sample-applications/IQ-9075_gst-ai-multistream-inference.png" alt="" />

**Expected Output:**

<img src="https://mintlify.s3.us-west-1.amazonaws.com/qualcomm-prod/images/run-sample-applications/IQ9075_AI_multistream_inference.png" alt="" />

5. To display the available help options, run the following command in the SSH shell:

```bash theme={null}
gst-ai-multistream-inference -h
```

**For Debug Messages:**\
Set GST\_DEBUG environment variable used by GStreamer to control the verbosity and category of debug messages.

```shell theme={null}
export GST_DEBUG=3
```

6. To stop the application, press **CTRL + C**

## Sample Application Configuration Matrix

| Sample App Name                            | Details                                                                                                                                                      | AI Hub Model Type                                                                                                             | Runtime       | Script to Use                                                                                                                                                                                                                                                                     |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| gst-ai-classification                      | [Image classification](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-ai-classification.html)                                        | MobileNet-v2, ResNet101, GoogLeNet, MobileNet-v3-Large, ResNet18, ResNeXt50, ResNeXt101, SqueezeNet, WideResNet50, Shufflenet | CPU, GPU, DSP | [Update 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-classification/config_classification.json?ref_type=heads)                                                                |
| gst-ai-object-detection                    | [Object detection](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-ai-object-detection.html)                                          | Yolox, Yolov7, Yolov8-Detection (manual export)                                                                               | CPU, GPU, DSP | Export model from AI Hub; Update script for Yolox/Yolov7 – [Update 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-classification/config_classification.json?ref_type=heads)     |
| gst-ai-pose-detection                      | [Pose detection](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-ai-pose-detection.html)                                              | hrnet\_pose                                                                                                                   | CPU, GPU, DSP | TFLite works by default; update script for precision/runtime – [Update 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-classification/config_classification.json?ref_type=heads) |
| gst-ai-segmentation                        | [Image segmentation](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-ai-segmentation.html)                                            | FFNet-40S, FFNet-54S, FFNet-78S                                                                                               | CPU, GPU, DSP | [Update 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-classification/config_classification.json?ref_type=heads)                                                                |
| gst-ai-superresolution                     | [Video super-resolution](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/video-super-resolution.html)                                     | quicksrnetsmall, QuickSRNetMedium, QuickSRNetLarge, XLSR                                                                      | CPU, GPU, DSP | [Update 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-classification/config_classification.json?ref_type=heads)                                                                |
| gst-ai-multistream-batch-inference         | [Multistream batch inference](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/multistream-batch-inference.html)                           | YoloV8-Detection (batch 4), DeeplabV3 (batch 4)                                                                               | CPU, GPU, DSP | Export model from AI Hub; Update script – [Update 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-classification/config_classification.json?ref_type=heads)                      |
| gst-ai-face-detection                      | [Face detection](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-ai-face-detection.html)                                              | face\_det\_lite                                                                                                               | CPU, GPU, DSP | [Update 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-classification/config_classification.json?ref_type=heads)                                                                |
| gst-ai-face-recognition                    | [Face recognition](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-ai-face-recognition.html)                                          | face\_det\_lite, face\_attrib\_net, facemap\_3dmm                                                                             | CPU, GPU, DSP | Face registration required; otherwise output is 'unknown face recognized'                                                                                                                                                                                                         |
| gst-ai-metadata-parser-example             | [Metadata parsing](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-ai-metadata-parser.html)                                           | Yolov8-Detection                                                                                                              | CPU, GPU, DSP | Export model from AI Hub                                                                                                                                                                                                                                                          |
| gst-ai-usb-camera-app                      | [AI USB camera](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-ai-metadata-parser.html)                                              | Yolov8-Detection                                                                                                              | CPU, GPU, DSP | Export model from AI Hub                                                                                                                                                                                                                                                          |
| gst-ai-parallel-inference                  | [Parallel inferencing](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-ai-parallel-inference.html)                                    | Yolov8-Detection, Deeplab, Hrnet, Inceptionv3                                                                                 | CPU, GPU, DSP | Export model from AI Hub; [Update 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-classification/config_classification.json?ref_type=heads)  for other models                    |
| gst-ai-daisychain-detection-classification | [Daisy chain detection and classification](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/daisy-chain-detection-and-classification.html) | Inceptionv3 + YoloV8                                                                                                          | CPU, GPU, DSP | Export model from AI Hub; [Update 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-classification/config_classification.json?ref_type=heads)  for other models                    |
| gst-ai-audio-classification                | [Audio classification](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/audio-classification.html)                                         | Inceptionv3 + YoloV8                                                                                                          | CPU, GPU, DSP | Export model from AI Hub; [Update 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-classification/config_classification.json?ref_type=heads)  for other models                    |
| gst-ai-smartcodec-example                  | [AI smart codecn](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/ai-smart-codec.html)                                                    | Inceptionv3 + YoloV8                                                                                                          | CPU, GPU, DSP | Export model from AI Hub; [Update 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-classification/config_classification.json?ref_type=heads)  for other models                    |

## Reference Docs

To further explore sample applications, see the Qualcomm Intelligent Multimedia SDK (IM SDK) Reference Guide. [Qualcomm Intelligent Multimedia SDK (IM SDK) Reference](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/example-applications.html)
