Skip to main content
This guide explains how to modify an existing Qualcomm IM SDK reference application to work with a custom-trained model. It uses a custom-trained YOLOv8 model as an example.

Use a custom-trained YOLOv8 LiteRT model

Qualcomm IM SDK reference applications use the YOLOv8 model for object detection. This example explains how to run a custom-trained YOLOv8 variant with the current reference application. To run your own custom-trained YOLOv8 model, complete the following steps:
  1. Replace the existing model with your new model in the reference application.
  2. Update the label files with your custom labels.
  3. Run the reference application with the updated model.

Update the label files

The Qualcomm IM SDK reference applications expect labels in JSON format. Update the id, color, and label values for each entry in the labels file. The format for each label entry is:
For example:

Run object detection with the custom model

To run object detection using the LiteRT runtime with your custom model and label files, complete the following steps:
1

Set the user environment variable on the host computer

2

Create the artifact directories

3

Copy the model to the device

4

Copy the label file to the device

5

Sign in to the device using SSH

6

Run the object detection application with sample configuration file

This command runs the application using the sample configuration in /etc/configs/config_detection.json.To stop the application, press Ctrl+C.
7

(Optional) Run the object detection application with a custom configuration file

You can use a custom configuration file by specifying its path with --config-file:
If --config-file is specified, the application uses that file. Otherwise, it searches for config_detection.json in the following order:To create a user-specific configuration, copy the sample file to the user configuration directory:
To view the available command-line options, run:
Edit the config_detection.json configuration file
The application uses $HOME/Downloads/qimsdk_samples as its artifact directory. When a relative path or filename is specified, it is resolved against the corresponding subdirectory below. Alternatively, absolute paths are used as provided.
Run the application:
When running, the application displays the video stream on the connected monitor with bounding box results overlaid on each frame.