# 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 and SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/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. Sign in to the target device using SSH:
ssh root@
Copy to clipboard
3. Download the automated script used to download model and label files to the
`/etc/models` and `/etc/labels` directories on the target device:
curl -L -O https://raw.githubusercontent.com/quic/sample-apps-for-qualcomm-linux/refs/heads/main/download_artifacts.sh
Copy to clipboard
Note
Run this script on the target device. Ensure that the target device has a valid Internet connection.
4. Set permissions for the script:
chmod +x download_artifacts.sh
Copy to clipboard
5. Run the script with the required arguments to download model and label files to the target device:
./download_artifacts.sh -v GA1.5-rel -c
Copy to clipboard
Replace `` with QCS6490, QCS9075, or QCS8275.
6. The YOLOv8 model is not available by default.
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/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 build directory.
4. Copy the models to the device in the `/etc/models/` directory.
scp /build/yolov8_det_quantized/yolov8_det_quantized.tflite root@:/etc/models/
Copy to clipboard
- [YOLOv8-Detection-Quantized](https://github.com/quic/ai-hub-models/tree/main/qai_hub_models/models/yolov8_det)
- [Yolo-NAS-Quantized](https://github.com/quic/ai-hub-models/tree/main/qai_hub_models/models/yolonas)
The current release (GA 1.5) uses Qualcomm AI Runtime SDK v2.35.
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 --chipset="qualcomm-qcs6490-proxy" --compile-options="--qairt_version 2.35" --profile-options "--qairt_version 2.35"
> 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 --chipset="qualcomm-qcs6490-proxy"
> Copy to clipboard
To change the batch size of the model, update `` in the following export command:
python -m qai_hub_models.models..export --quantize w8a8 --batch-size --device "QCS6490 (Proxy)"
Copy to clipboard
7. Update the `q_offset` and `q_scale` constants of the quantized LiteRT model in the JSON file. For instructions, see [get model constants](https://docs.qualcomm.com/doc/80-70020-15B/topic/integrate-ai-hub-models.html#get-model-constants).
8. 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 root@:/etc/models
Copy to clipboard
For example:
scp inception_v3_quantized.tflite root@:/etc/models
Copy to clipboard
Note
If you want to run sample applications from the UART shell, remount the file system
with read/write permission using the following command on the target device:
mount -o remount,rw /usr
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. 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