# 对图像进行分类

在为某个模型运行 pipeline 命令之前，请遵循所需的[先决条件](https://docs.qualcomm.com/doc/80-70022-15BY/topic/ai-hub-qualcomm-im-sdk.html#prerequisites)。

在运行分类命令之前，在 SSH shell 中运行以下命令。

export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1
    Copy to clipboard

## GoogLeNet

GoogLeNet 是一种机器学习模型，可以对 Imagenet 数据集中的图像进行分类。它还可用于为特定用例构建更复杂的模型。

AI Hub 模型基于 [GoogLeNet 的实现](https://github.com/pytorch/vision/blob/main/torchvision/models/googlenet.py)。

- 模型：[GoogLeNet](https://aihub.qualcomm.com/iot/models/googlenet)
- 标签：[classification.json](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/artifacts/json_labels/classification.json)

Note

当使用此模型进行推理时，分类标签可能不会显示

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<640, 360>" ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/googlenet_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 51.0}" results=5 module=mobilenet-softmax labels=/etc/labels/classification.json \
    ! video/x-raw,format=BGRA,width=640, height=360 ! queue ! mixer.
    Copy to clipboard

## Inception-v3

InceptionNetV3 是一种机器学习模型，可以对 Imagenet 数据集中的图像进行分类。它还可用于为特定用例构建更复杂的模型。

该模型使用来自 Google 开放图像数据集的样本并在训练后量化为 int8。

AI Hub 模型基于 [Inception-v3 的实现](https://github.com/pytorch/vision/blob/main/torchvision/models/inception.py)。

- 模型：[Inception-v3](https://aihub.qualcomm.com/iot/models/inception_v3)
- 标签：[classification.json](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/artifacts/json_labels/classification.json)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<640, 360>" ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/inception_v3_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 51.0}" results=5 module=mobilenet-softmax labels=/etc/labels/classification.json \
    ! video/x-raw,format=BGRA,width=640, height=360 ! queue ! mixer.
    Copy to clipboard

## ResNet18

ResNet18 是一种机器学习模型，可以对 Imagenet 数据集中的图像进行分类。它还可用于为特定用例构建更复杂的模型。

AI Hub 模型基于 [ResNet18 的实现](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py)。

- 模型：[ResNet18](https://aihub.qualcomm.com/iot/models/resnet18)
- 标签：[classification.json](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/artifacts/json_labels/classification.json)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<640, 360>" ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/resnet18_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 30.0}" results=5 module=mobilenet-softmax labels=/etc/labels/classification.json ! video/x-raw,format=BGRA,width=640, height=360 ! queue ! mixer.
    Copy to clipboard

## ResNet101

ResNet101 是一种机器学习模型，可以对 Imagenet 数据集中的图像进行分类。它还可用于为特定用例构建更复杂的模型。

AI Hub 模型基于 [ResNet101 的实现](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py)。

- 模型：[ResNet101](https://aihub.qualcomm.com/iot/models/resnet101)
- 标签：[classification.json](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/artifacts/json_labels/classification.json)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<640, 360>" ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/resnet101_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 51.0}" results=5 module=mobilenet-softmax labels=/etc/labels/classification.json ! \
    video/x-raw,format=BGRA,width=640, height=360 ! queue ! mixer.
    Copy to clipboard

## ResNeXt50

ResNeXt50 是一种机器学习模型，可以对 Imagenet 数据集中的图像进行分类。它还可用于为特定用例构建更复杂的模型。

AI Hub 模型基于 [ResNeXt50 的实现](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py)。

- 模型：[ResNeXt50](https://aihub.qualcomm.com/iot/models/resnext50)
- 标签：[classification.json](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/artifacts/json_labels/classification.json)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<640, 360>" ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/resnext50_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 35.0}" results=5 module=mobilenet-softmax labels=/etc/labels/classification.json ! video/x-raw,format=BGRA,width=640, height=360 ! queue ! mixer.
    Copy to clipboard

## ResNeXt101

ResNeXt101 是一种机器学习模型，可以对 Imagenet 数据集中的图像进行分类。它还可用于为特定用例构建更复杂的模型。

AI Hub 模型基于 [ResNeXt101 的实现](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py)。

- 模型：[ResNeXt101](https://aihub.qualcomm.com/iot/models/resnext101)
- 标签：[classification.json](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/artifacts/json_labels/classification.json)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<640, 360>" ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/resnext101_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 35.0}" results=5 module=mobilenet-softmax labels=/etc/labels/classification.json ! \
    video/x-raw,format=BGRA,width=640, height=360 ! queue ! mixer.
    Copy to clipboard

## Shufflenet-v2

ShufflenetV2 是一种机器学习模型，可以对来自 Imagenet 数据集的图像进行分类。它还可用于为特定用例构建更复杂的模型。

AI Hub 模型基于 [Shufflenet-v2 的实现](https://github.com/pytorch/vision/blob/main/torchvision/models/shufflenetv2.py)。

- 模型：[Shufflenet-v2](https://aihub.qualcomm.com/iot/models/shufflenet_v2)
- 标签：[classification.json](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/artifacts/json_labels/classification.json)

Note

当使用此模型进行推理时，分类标签可能不会显示

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<640, 360>" ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/shufflenet_v2_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 35.0}" results=5 module=mobilenet-softmax labels=/etc/labels/classification.json ! \
    video/x-raw,format=BGRA,width=640, height=360 ! queue ! mixer.
    Copy to clipboard

## SqueezeNet-1\_1

SqueezeNet 是一种机器学习模型，可以对来自 Imagenet 数据集的图像进行分类。它还可用于为特定用例构建更复杂的模型。

AI Hub 模型基于 [SqueezeNet-1_1 的实现](https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py)。

- 模型：[SqueezeNet-1_1](https://aihub.qualcomm.com/iot/models/squeezenet1_1)
- 标签：[classification.json](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/artifacts/json_labels/classification.json)

Note

当使用此模型进行推理时，分类标签可能不会显示

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<640, 360>" ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/squeezenet1_1_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 25.0}" results=5 module=mobilenet-softmax labels=/etc/labels/classification.json ! \
    video/x-raw,format=BGRA,width=640, height=360 ! queue ! mixer.
    Copy to clipboard

## WideResNet50

WideResNet50 是一种机器学习模型，可以对来自 Imagenet 数据集的图像进行分类。它还可用于为特定用例构建更复杂的模型。

AI Hub 模型基于 [WideResNet50 的实现](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py)。

- 模型：[WideResNet50](https://aihub.qualcomm.com/iot/models/wideresnet50)
- 标签：[classification.json](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/artifacts/json_labels/classification.json)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<640, 360>" ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/wideresnet50_quantized.tflite ! queue ! \
    qtimlpostprocess settings="{\"confidence\": 35.0}" results=5 module=mobilenet-softmax labels=/etc/labels/classification.json ! \
    video/x-raw,format=BGRA,width=640,height=360 ! queue ! mixer.
    Copy to clipboard

Last Published: Nov 05, 2025

[Previous Topic
使用 AI Hub 模型和标签与 GStreamer API](https://docs.qualcomm.com/bundle/publicresource/80-70022-15BY/topics/ai-hub-qualcomm-im-sdk.md) [Next Topic
检测对象](https://docs.qualcomm.com/bundle/publicresource/80-70022-15BY/topics/object-detection.md)