# Image classification
Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/gst-ai-classification.html](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-ai-classification.html)
The **gst-ai-classification** application allows you to identify the subject in an
image. The use cases are implemented using the Qualcomm Neural Processing SDK, LiteRT, or
Qualcomm AI Engine direct models.
The following figure shows the pipeline, which receives a video stream from a camera,
file source, USB source, or Real-Time Streaming Protocol (RTSP), preprocesses it, and
runs the inference on AI hardware. The results are either displayed on the screen, saved
as an encoded MP4 file, or streamed over the RTSP server.
For information about the plugins used for classification, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-ai-classification.html#gst-ai-classification__section_j5t_2jq_nbc).
Figure : gst-ai-classification pipeline
## Sample model and label files
| Runtime | Model files | Label files |
| --- | --- | --- |
| Qualcomm Neural Processing SDK | inceptionv3.dlc | classification.json |
| LiteRT | inception_v3_quantized.tflite | classification.json |
| Qualcomm AI Engine direct | inception_v3_quantized.bin | classification.json |
| | | |
| | | |
## Run the application on the target device
The sample application uses the
/etc/configs/config\_classification.json file to read the
input parameters.
To create your own config JSON file, use [config_classification.json](https://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/gst-plugins-qti-oss/-/blob/imsdk.lnx.2.0.0.r2-rel/gst-sample-apps/gst-ai-classification/config_classification.json?ref_type=heads) as a
reference.
1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70022-50/topic/download-model-and-label-files.html).
2. Update the config JSON file based on the model, input stream, and other
properties. For more information, see [Config JSON field description](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-ai-classification.html#gst-ai-classification__section_lcw_2zj_32c).
3. Use the following format of the config\_classification.json
file.
{
"file-path": "",
"ml-framework": "",
"model": "",
"labels": "",
"threshold": ,
"runtime": "",
"output-tye": "waylandsink or filesink or rtspsink"
}Copy to clipboard
For example, run the application using input from a file, LiteRT
model, DSP runtime, and custom threshold
value:
{
"file-path": "/etc/media/video.mp4",
"ml-framework": "tflite",
"model": "/etc/models/inception_v3_quantized.tflite",
"labels": "/etc/labels/classification.json",
"threshold": 40,
"runtime": "dsp",
"output-type": "waylandsink"
}Copy to clipboard
4. Run the gst-ai-classification
application:
gst-ai-classification --config-file=/etc/configs/config_classification.jsonCopy to clipboard
Note: For USB camera input, set the
`video-format`, `resolution`, and
`framerate` parameters in the configuration file to match
the capabilities of the camera. To check the camera capabilities, see [Configure USB camera](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-8/usb.html#configure-usb-camera).
5. To display the available help options, run the following command in the SSH
shell:
gst-ai-classification -hCopy to clipboard
6. To stop the use case, use CTRL +
C.
## Expected output
The classified object is displayed on the local display.
Figure : Expected output for gst-ai-classification application

## Pipeline flow
The following table lists the plugins used in the object classification
pipeline:
| Plugin | Description |
| --- | --- |
| Camera source:[qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70022-50/topic/qtiqmmfsrc.html) |
Captures the live stream from camera.
Uses tee to split the stream for inferencing.
|
| File source: filesrc |
Captures the video stream using filesrc, followed by qtdemux, which demultiplexes the stream.
Uses tee to split the stream for inferencing.
|
| RTSP source: rtspsrc |
Captures the RTSP stream using rtspsrc, followed by rtph264depay for video extraction.
Uses tee to split the stream for inferencing.
|
| USB camera source: v4l2src |
Captures the live stream from USB camera.
Uses tee to split the stream for inferencing.
|
| h264parse | Parses the H.264 video. |
| [v4l2h264dec](https://docs.qualcomm.com/doc/80-70022-50/topic/v4l2h264dec.html) | Decodes the video. |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70022-50/topic/qtimlvconverter.html) |
Receives the video stream on its sink pad.
Performs the following preprocessing on the stream data. This preprocessing is done when the model expects floating-point values as input.
Color conversion
Scaling (up or down)
Normalization
Converts the preprocessed video stream to a tensor stream on its source pad.
The tensor stream is used for inferencing in the later stages of the pipeline. |
| Inferencing plugins:
Waylandsink submits the video stream received on its sink pad to Weston.
Weston renders the video stream on a local display.
|
| filesink | Takes the video stream that it receives on its sink pad and saves it as an H.264-encoded MP4 file. |
| qtirtspbin |
Serves as a network sink.
Transmits UDP packets to the network.
|
## Config JSON field description
The different parameters available to configure the JSON file and run the use case
are as follows:
| Field | Values/description |
| :--- | :--- |
| **ml-framework** | Use one of the following models:
snpe: Qualcomm Neural Processing SDK
tflite: LiteRT
qnn: Qualcomm AI Engine direct
|
| **runtime** | Use one of the following runtimes:
cpu
gpu
dsp
|
| **output-ip-address** | Output server IP address. |
| **port** | Output server port. |
| **USB camera video-format and resolution** | Use one of the following video-formats:
nv12
yuy2
mjpeg
Use the following resolution parameters:
width: Input USB camera source resolution width.
height: Input USB camera source resolution height.
framerate: Input USB camera source framerate.
|
| **output-file** | Name of the output file. The default output file is `output_classification.mp4`. |
| **output-type** | Use one of the following output-type:
waylandsink: To display output on Wayland.
filesink: To store output in file.
rtspsink: To stream output on server.
|
| **Input source** | Use one of the following input sources:
camera: Primary (0) or secondary (1).
file-path: The directory path to the video file.
rtsp-ip-port: The address of the RTSP stream: rtsp://<ip>:<port>/<stream>.
usb-camera: Set enable-usb-camera as TRUE to use USB camera as input source.
|
## Related information
- [Image classification and display with LiteRT](https://docs.qualcomm.com/doc/80-70022-50/topic/single-camera-stream-with-image-classification-and-display-with-litert.html)
- [Image classification and encode with LiteRT](https://docs.qualcomm.com/doc/80-70022-50/topic/single-camera-stream-with-image-classification-and-encode.html)
- [Image classification and display with Neural Processing SDK](https://docs.qualcomm.com/doc/80-70022-50/topic/single-camera-stream-with-image-classification-and-display-with-mobilenet-v1.html)
- [Image classification and encode with Neural Processing SDK](https://docs.qualcomm.com/doc/80-70022-50/topic/single-camera-stream-with-image-classification-and-encode-with-mobilenet-v1.html)
**Parent Topic:** [Run AI/ML sample applications](https://docs.qualcomm.com/doc/80-70022-50/topic/ai-ml-sample-applications.html)
Last Published: Feb 20, 2026
[Previous Topic
Prerequisites](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/download-model-and-label-files.md) [Next Topic
Object detection](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/gst-ai-object-detection.md)