# Get started
Source: [https://docs.qualcomm.com/doc/80-70017-54/topic/getting-started.html](https://docs.qualcomm.com/doc/80-70017-54/topic/getting-started.html)
This guide explains how to run LiteRT models on the Qualcomm Linux Development
Kit.
Before you get started, do the following:
1. Set up the Qualcomm Linux Development Kit. For instructions, see the following:
- QCS6490/QCS5430: [RB3 Gen 2 Quick Start Guide](bundle/publicresource/topics/80-70017-253)
- QCS9075: [Qualcomm IQ-9 Beta Evaluation Kit Quick
Start Guide](https://docs.qualcomm.com/bundle/80-70015-263/resource/80-70015-263_REV_AE_Qualcomm_IQ-9_Beta_Evaluation_Kit_Quick_Start_Guide.pdf)
- QCS8275: [Qualcomm IQ-8 Beta Evaluation Kit Quick
Start Guide](https://docs.qualcomm.com/bundle/80-70017-263/resource/80-70017-263_REV_AA_Qualcomm_IQ-8_Beta_Evaluation_KitQuick_Start_Guide.pdf)
Note: The QCS9075 and QCS8275 quick start guides are
available for authorized users only. To upgrade your access, go to [www.qualcomm.com/support/working-with-qualcomm](https://www.qualcomm.com/support/working-with-qualcomm).
2. Connect the Qualcomm Linux Development Kit to a monitor using HDMI.
3. Upgrade the Qualcomm Linux Development Kit to the latest software release available
on [CodeLinaro Artifactory Service](https://artifacts.codelinaro.org/ui/native/qli-ci/flashable-binaries/).
4. Flash the image to the device. For instructions, see [Flash images](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-254/flash_images.html).
## Run a LiteRT model using the Gstreamer-based IM SDK
Source: [https://docs.qualcomm.com/doc/80-70017-54/topic/getting-started.html](https://docs.qualcomm.com/doc/80-70017-54/topic/getting-started.html)
The Qualcomm Linux Development Kit comes with precompiled LiteRT sample applications
to run sample LiteRT models.
The gst-ai-classification sample application uses the IM SDK plug-ins to run a LiteRT
classification model on the Qualcomm Linux Development Kit with hardware acceleration
using LiteRT delegates.
Figure : Workflow to run a LiteRT model using IM SDK
The gst-ai-classification sample application does the following:
1. Opens the IMX577 camera on the Qualcomm Linux Development Kit with a specific
resolution and frame rate; for example, 1080p at 30 fps
2. Preprocesses each camera frame to provide the input data to a classification
model
For example, the gst-ai-classification sample application:
1. Downscales a 1080p frame to a 224 x 224 resolution
2. Normalizes the input frame based on the model requirements
3. The qtimltflite IM SDK plug-in, built on top of the LiteRT C++ API, does the
following:
1. Loads the sample LiteRT classification model
2. Performs inference on the model using hardware acceleration
4. Postprocesses the output from the inference, that is, extracts the label with the
highest predicted probability within the output tensor
5. Overlays the inference result on the original camera input image and displays it on
the connected monitor
### Download and copy a sample model
To download and copy a model and a label file to the device, do the following:
1. Go to [Qualcomm^®^ AI Hub](https://aihub.qualcomm.com/iot/models/inception_v3_quantized?searchTerm=inception) and
download the Inception-v3-Quantized model. 
Note: The
gst-ai-classification sample application is demonstrated for
QCS6490.
2. To download the corresponding label file, run the following
command:
wget https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/labels/imagenet_labels.txtCopy to clipboard
Note: The model is hosted on Qualcomm AI Hub and the
corresponding label file is hosted on QUIC GitHub.
3. To copy the models and label files to the device using the secure copy protocol
(SCP), run the following
commands:
# For SCP, run the following command:
ssh root@[ip-addr]
mount -o remount,rw /
exitCopy to clipboard
# Copy files securely
scp imagenet_labels.txt root@[ip-addr]:/opt/
scp inception_v3_quantized.tflite root@[ip-addr]:/opt/
Copy to clipboard
Note: To get the IP address of the
Qualcomm Linux Development Kit, run the following
command:
ifconfig wlan0Copy to clipboard
Note: When prompted for a password, enter
oelinux123.
### Execute a LiteRT model with a sample application
1. To run inference using
LiteRT:
ssh root@[ip-addr]Copy to clipboard
# Setup Wayland Display environment
export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1Copy to clipboard
1. Modify the config\_classification.json file in the
opt folder, as follows:
{
"file-path": "/opt/video.mp4",
"ml-framework": "tflite",
"model": "/opt/inception_v3_quantized.tflite",
"labels": "/opt/imagenet_labels.txt",
"constants": "Mobilenet,q-offsets=<38.0>,q-scales=<0.15008972585201263>;"
}Copy to clipboard
Note: You must push the video.mp4
file to the opt folder.
2. Run the classification sample
application:
gst-ai-classification --config-file=/opt/config_classification.jsonCopy to clipboard
2. To run the sample application using a custom classification model and labels
file, use the following arguments:
- `--model`
- `--labels`
1. Modify the config\_classification.json file in the
opt folder, as follows:
{
"file-path": "/opt/video.mp4",
"model":"/opt/custom_model.tflite",
"ml-framework": "tflite",
"labels": "/opt/custom_labels.txt"
}Copy to clipboard
2. Run the classification sample
application:
gst-ai-classification --config-file=/opt/config_classification.jsonCopy to clipboard
3. To stop the sample application, press CTRL+C.
When the sample application is running, it displays the camera stream on the
connected monitor with inference results overlaid on the frame.
## Run a LiteRT model using a native LiteRT sample application
Source: [https://docs.qualcomm.com/doc/80-70017-54/topic/getting-started.html](https://docs.qualcomm.com/doc/80-70017-54/topic/getting-started.html)
You can run LiteRT models using a sample LiteRT application called label\_image, which
is a part of the TensorFlow repository.
The label\_image sample application and the LiteRT library are cross-compiled with
Qualcomm Linux and installed on the target device.
The label\_image sample application does the following:
1. Loads a classification LiteRT model
2. Performs inference on an image using a delegate to accelerate the model on Qualcomm
hardware
To run a model using the label\_image sample application, do the following:
1. Download the sample model, corresponding labels, and an example image:
- BMP file from [here](https://github.com/sourcecode369/tensorflow-1/tree/master/tensorflow/lite/examples/label_image/testdata/)
- MobileNet LiteRT model from [here](https://github.com/emgucv/models/blob/master/mobilenet_v1_1.0_224_float_2017_11_08/mobilenet_v1_1.0_224.tflite)
2. Run the following commands on the host
machine:
wget http://download.tensorflow.org/models/mobilenet_v1_2018_08_02/mobilenet_v1_1.0_224_quant.tgzCopy to clipboard
tar -xvf mobilenet_v1_1.0_224_quant.tgzCopy to clipboard
wget https://storage.googleapis.com/download.tensorflow.org/models/mobilenet_v1_1.0_224_frozen.tgzCopy to clipboard
tar -xvf mobilenet_v1_1.0_224_frozen.tgzCopy to clipboard
# For SCP, run the following command:
ssh root@[ip-addr]
mount -o remount,rw /
exitCopy to clipboard
scp mobilenet_v1_1.0_224_quant.tflite root@[ip-addr]:/opt/
scp grace_hopper.bmp root@[ip-addr]:/opt/
scp mobilenet_v1_1.0_224/labels.txt root@[ip-addr]:/opt/
scp mobilenet_v1_1.0_224.tflite root@[ip-addr]:/opt/
Copy to clipboard
3. To run an inference using one of the following delegates, do the following:
- To run the model on the Arm^®^ CPU using the XNNPACK
delegate:
label_image -l /opt/labels.txt -i /opt/grace_hopper.bmp -m /opt/mobilenet_v1_1.0_224_quant.tflite -c 10 -p 1 --xnnpack_delegate 1Copy to clipboard
- To run the model on the Qualcomm^®^ Adreno™ GPU using the GPU
delegate:
label_image -l /opt/labels.txt -i /opt/grace_hopper.bmp -m /opt/mobilenet_v1_1.0_224.tflite -c 10 -p 1 --gl_backend 1Copy to clipboard
Last Published: Jan 06, 2025
[Previous Topic
Overview](https://docs.qualcomm.com/bundle/publicresource/80-70017-54/topics/tflite-landing-page.md) [Next Topic
LiteRT architecture](https://docs.qualcomm.com/bundle/publicresource/80-70017-54/topics/arch.md)