# Prerequisites

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/download-model-and-label-files.html](https://docs.qualcomm.com/doc/80-70022-50/topic/download-model-and-label-files.html)

Complete these preconditions before running the AI/ML sample
        applications.

1. Activate SSH on your Qualcomm Linux or Ubuntu host to sign in with SSH and
                    connect to the target device. For instructions see:
    - [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-254/how_to.html#use-ssh) for Qualcomm
                            Linux
    - [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-90441-1/Use_Ubuntu_on_RB3_Gen2_3.html#sign-in-to-the-rb3-gen-2-console-using-ssh) for Ubuntu
                            Server

Note: If SSH is already set up and Wi-Fi is
                        connected, skip this step.
2. Sign in to the target device using SSH:
    - For Qualcomm
                            Linux:

            ssh root@<ip address of target device>Copy to clipboard
    - For Ubuntu
                            Server:

            ssh ubuntu@<ip address of target device> Copy to clipboard
3. On the target device, obtain the `download_artifacts.sh` script,
                    set executable permissions, and run it to download the model, media, and label
                        files:

        cd /tmp/Copy to clipboard

        curl -L -O https://raw.githubusercontent.com/quic/sample-apps-for-qualcomm-linux/refs/heads/main/qualcomm-linux/scripts/download_artifacts.shCopy to clipboard

        chmod +x download_artifacts.shCopy to clipboard

        ./download_artifacts.shCopy to clipboard

Note: For the Ubuntu build, use the `sudo`
                        command.
4. The YOLOv8 model isn't available by default. You can use the following options
                    to either download the models using a script or export them with Qualcomm AI Hub
                    APIs on the Linux host computer. 
    If you are using [Multistream batch inference](https://docs.qualcomm.com/doc/80-70022-50/topic/multistream-batch-inference.html) application, you can generate
                        a batch model.

    1. Download the models using a script:
        1. Create a [Qualcomm AI Hub
                                        account](https://app.aihub.qualcomm.com/account/).
        2. Select the account name, then go to
                                        Settings in the upper right corner,
                                    and select the API token.
        3. Export the models on the Linux host computer and set the
                                    required
                                        permissions:

                curl -L -O https://raw.githubusercontent.com/quic/sample-apps-for-qualcomm-linux/refs/heads/main/qualcomm-linux/scripts/export_model.shCopy to clipboard

                chmod +x export_model.shCopy to clipboard

            Replace
                                            <var class="keyword varname">API_TOKEN</var> with the selected
                                    key:

                ./export_model.sh --api-token=<API_TOKEN>Copy to clipboard
    2. Export the [YOLOv8-Detection-Quantized](https://github.com/quic/ai-hub-models/tree/main/qai_hub_models/models/yolov8_det) model using Qualcomm AI Hub
                                APIs.
Run the following command from the python environment that's
                                created from `export_model.sh`. For example, to
                                export the YOLOv8 LiteRT
                                model:

            python -m qai_hub_models.models.yolov8_det.export --quantize w8a8 --target-runtime=tflite --device="Dragonwing RB3 Gen 2 Vision Kit"Copy to clipboard
    3. Generate a batch model. 
        To change the batch size of the model, update
                                    <var class="keyword varname">&lt;N&gt;</var> in the following
                                    `export`
                                command:

            python -m qai_hub_models.models.<Model_Name>.export --batch-size <N> --device="Dragonwing RB3 Gen 2 Vision Kit"Copy to clipboard

For
                                example, to export the YOLOv8 LiteRT model with `--batch-size
                                    4`, run the following command from the python
                                environment that's created from
                                `export_model.sh`:

            python -m qai_hub_models.models.yolov8_det.export --quantize w8a8 --target-runtime=tflite --device="Dragonwing RB3 Gen 2 Vision Kit"Copy to clipboard

For
                                example, to export the YOLOv8 QNN model, run the following command
                                from the python environment that's created from
                                    `export_model.sh`:

            python -m qai_hub_models.models.yolov8_det.export --quantize w8a8 --target-runtime=qnn_context_binary --device="Dragonwing RB3 Gen 2 Vision Kit" --compile-options="--qairt_version 2.40" --profile-options "--qairt_version 2.40"Copy to clipboard
5. A sample `video.mp4`file is made available in the
                        `/etc/media `directory of the target device with the download
                    script from step 5. If you are using a custom video, then ensure that you push
                    the video to `/etc/media` and update the file path in the
                        `config.JSON` file of the application.
6. Use the HDMI port to connect the display to the target device. For instructions,
                    see [Set up HDMI display](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-18/samples.html).
7. In the terminal of the target device, run the following command in the SSH shell
                    to activate the display:
    - For Qualcomm
                            Linux:

            export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1Copy to clipboard
    - For Ubuntu
                            Server:

            export XDG_RUNTIME_DIR=/run/user/$(id -u ubuntu)/ && export WAYLAND_DISPLAY=wayland-1Copy to clipboard

## Troubleshooting

- If you face issues with the camera or display, see [Camera troubleshooting](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-17/troubleshooting.html) and [Display troubleshooting](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-18/debug.html).
- If any model isn't available after downloading the script file, you can download
                    the model from [IoT–Qualcomm AI Hub](https://aihub.qualcomm.com/iot/models/) and push it to the target
                    device:

        scp <model filename> root@<IP addr of the target device>:/etc/modelsCopy to clipboard

For
                    example:

        scp mobilenet_v2_quantized.tflite root@<IP addr of the target device>:/etc/modelsCopy to clipboard
- To run the sample applications from the UART shell, remount the file system with
                    read/write permissions and execute the following commands on the target
                        device:
    - For Qualcomm
                            Linux:

            mount -o remount,rw /usrCopy to clipboard
    - For Ubuntu
                            Server:

            mount -o remount,rw /Copy to clipboard
- For Ubuntu Server, copy the model files to the user `home` folder
                    and then use `sudo` command to copy the files to the
                        `/etc/models`
                    directory:

        scp <modelfilename> ubuntu@<IP addr of the target device>:/home/ubuntu
        ssh ubuntu@<IP addr of the target device>
        sudo cp /home/ubuntu/<model filename> /etc/modelsCopy to clipboard

**Parent Topic:** [Run AI/ML sample applications](https://docs.qualcomm.com/doc/80-70022-50/topic/ai-ml-sample-applications.html)

Last Published: Feb 20, 2026

[Previous Topic
Run AI/ML sample applications](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/ai-ml-sample-applications.md) [Next Topic
Image classification](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/gst-ai-classification.md)