# Classify objects using a default model The *gst-ai-classification* sample application demonstrates the capability of hardware to perform classification on a video stream. The pipeline receives the video stream from the camera, file source, or real-time streaming protocol (RTSP), performs preprocessing, conducts inference on AI hardware, and displays the results on the screen. The *gst-ai-classification* application is part of the Qualcomm Intelligent Multimedia (QIM) SDK and can be run directly after flashing the device. You need to push the model and label files to the device to run the application. ## Download model and label files Note The following sections use placeholder model names for models downloaded through AI Hub. Update the model name in the commands with the appropriate model name as downloaded through AI Hub. To download the model and label files directly on the device, follow the steps below. 1. [Enable Wi-Fi](https://docs.qualcomm.com/doc/80-80022-254/topic/how_to.html#connect-to-the-network) and [SSH](https://docs.qualcomm.com/doc/80-80022-254/topic/how_to.html#use-ssh). > > > The device needs an internet connection to download the artifacts required to run sample applications. > If you have already enabled SSH and connected to the internet with Wi-Fi, skip this step. 2. On the host device, run the following command: export USER=root Copy to clipboard 3. Sign in to the target device using SSH: ssh $USER@ Copy to clipboard 4. On the target device, download the `download_artifacts.sh` script, set executable permissions, and run it with the required arguments to download the model and label files to the device. 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.sh Copy to clipboard chmod +x download_artifacts.sh Copy to clipboard ./download_artifacts.sh Copy to clipboard 5. The YOLOv8 model isn’t available by default (Optional). Download them using the provided script or export them with AI Hub APIs. If you are using the `gst-ai-multistream-batch-inference` application, generate a batch model. Tab Download them with a script Tab Export them with AI Hub APIs Tab Generate a batch model 1. Create a [Qualcomm AI Hub account](https://app.aihub.qualcomm.com/account/). 2. Select the account name > go to **Settings** in the upper right corner > select the API key. 3. Run the following commands on the Linux host: curl -L -O https://raw.githubusercontent.com/quic/sample-apps-for-qualcomm-linux/refs/heads/main/qualcomm-linux/scripts/export_model.sh Copy to clipboard chmod +x export_model.sh Copy to clipboard Replace `` with the selected key: ./export_model.sh --api-key= Copy to clipboard After executing the script, the models will be downloaded to the `export_assets` directory. 4. Copy the models to the device in the `/etc/models/` directory. scp /export_assets/yolov8_det-tflite-w8a8/yolov8_det.tflite $USER@:/etc/models/ Copy to clipboard - [YOLOv8-Detection-Quantized](https://github.com/qualcomm/ai-hub-models/tree/v0.52.0/src/qai_hub_models/models/yolov8_det) - Current releases use the following SDK versions: - Qualcomm Linux (2.0.rc3): Qualcomm AI Runtime SDK v2.43.0.260128. - Ubuntu (x08): Qualcomm AI Runtime SDK 2.43.0.260128 For example, to export the YoloV8 QNN model, run the following command: 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.43" --profile-options "--qairt_version 2.43" Copy to clipboard - Update the `--qairt_version` value in the command to match the version installed on your device. - To check the QAIRT version, run the following command on the target device: > > > qnn-net-run --version > Copy to clipboard - To find the QAIRT SDK versions that AIHUB supports for the export command, run the following command on your host machine: > > > qai-hub list-frameworks > Copy to clipboard - Run the following command in the AIHUB environment to view the supported devices and update the device parameter accordingly: > > > qai-hub list-devices > Copy to clipboard For example, to export the YoloV8 LiteRT model, run the following command: > > > python -m qai_hub_models.models.yolov8_det.export --quantize w8a8 --target-runtime=tflite --device="Dragonwing RB3 Gen 2 Vision Kit" > Copy to clipboard To change the batch size of the model, update `` in the following export command: python -m qai_hub_models.models..export --batch-size --device="Dragonwing RB3 Gen 2 Vision Kit" Copy to clipboard For example, run the following command in the Python environment created by export\_model.sh to export the YOLOv8 LiteRT model with –batch-size 4: python -m qai_hub_models.models.yolov8_det.export --quantize w8a8 --target-runtime=tflite --device="Dragonwing RB3 Gen 2 Vision Kit" --batch-size 4 Copy to clipboard 6. If a model isn’t available after downloading with the script, download it from [IoT-Qualcomm AI Hub](https://aihub.qualcomm.com/iot/models/) and copy it to the target device by running the following command on the host computer: scp $USER@:/etc/models Copy to clipboard For example: scp inception_v3_quantized.tflite $USER@:/etc/models Copy to clipboard Note If you want to run sample applications from the UART shell in Qualcomm Linux, remount the file system with read/write permission using the following command on the target device: mount -o remount,rw / Copy to clipboard ## Run the sample application Important The rest of this document assumes the following convention for default file locations: - `/etc/models/` for all model files - `/etc/labels/` for all label files - `/etc/media/` for all video files - `/etc/configs/` for all configuration files To run the reference application, run the following commands: 1. On the host device, run the following command: export USER=root Copy to clipboard 2. The `download_artifacts.sh` script downloads the sample `video.mp4` file to the `/etc/media` directory. If you wish to use your own video file, push the video file to the `/etc/media` directory using the command below and update the path in the configuration file. scp