# 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. rtspsrc rtph264 depay h264parse V4l2h264dec tee qtimlvconverter qtimltflite/qtimlsnpe/ qtimlqnn qtimlpostprocess qtivcomposer sink_1 sink_0 qtimlvconverter qtimltflite/qtimlsnpe/ qtimlqnn qtimlpostprocess sink_1 sink_0 filesrc qtdemux h264parse V4l2h264dec qtimlvconverter qtimltflite/qtimlsnpe/ qtimlqnn qtimlpostprocess sink_1 sink_0 qtiqmmfsrc qtimlvconverter qtimltflite/qtimlsnpe/ qtimlqnn qtimlpostprocess sink_1 sink_0 Qualcomm Opensource v4l2src v4l2src_caps waylandsink filesink qtirtspbin 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/bundle/publicresource/topics/80-70022-254/how_to.html#connect-to-the-network) and [SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-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. On the target device, obtain 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. 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 4. 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/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_w8a8/yolov8_det_w8a8.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) The current release (GA 1.6) uses Qualcomm AI Runtime SDK v2.38. 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 --chipset="qualcomm-qcs6490-proxy" --compile-options="--qairt_version 2.38" --profile-options "--qairt_version 2.38" > 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 5. 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