# 机器学习用例

Source: [https://docs.qualcomm.com/doc/80-70015-50SC/topic/machine-learning-use-cases.html](https://docs.qualcomm.com/doc/80-70015-50SC/topic/machine-learning-use-cases.html)

TensorFlow Lite runtime 和 Qualcomm Neural Processing SDK runtime 用于机器学习用例中的推理。

在运行用例之前，须完成 [GStreamer 命令行用例](https://docs.qualcomm.com/doc/80-70015-50SC/topic/gstreamer-application-use-cases.html)中提到的前提条件。

AI 示例程序需要设备中的模型和标签文件才能运行程序。运行 AI 示例程序的先决条件如下：

如需将文件推送到设备，可在 Linux 主机上运行以下命令：

1. 下载模型和标签文件：

        wget https://github.com/quic/sample-apps-for-qualcomm-linux/releases/download/GA1.2-rel/GA1.2-rel.zipCopy to clipboard
2. 提取文件：

        unzip GA1.2-rel.zipCopy to clipboard
3. 将模型和标签文件推送到设备：
    - **QCS6490**

            scp -r GA1.2-rel/QCS6490/* root@<IP address of target device>:/opt/Copy to clipboard
    - **QCS9075**

            scp -r GA1.2-rel/QCS9075/* root@<IP address of target device>:/opt/Copy to clipboard

该用例使用 MobileNet TFLite 模型对单个摄像头流的场景进行分类，并叠加或组合分类标签。

1. 创建 Python 3.8 虚拟环境：

        sudo apt-get install python3.8Copy to clipboard

        python3.8 -m venv py3.8Copy to clipboard

        source py3.8/bin/activateCopy to clipboard
2. 生成 yolov5.tflite 模型：

        git clone https://github.com/ultralytics/yolov5.gitCopy to clipboard

        cd yolov5Copy to clipboard

        python -m pip install -r requirements.txt tensorflow-cpuCopy to clipboard

        python export.py --weights yolov5m.pt --img 320 --include tflite --int8 -- data data/coco128.yamlCopy to clipboard

        scp yolov5m-int8.tflite root@<IP address of the device>:/opt/yolov5.tfliteCopy to clipboard

YOLO-NAS 和 YOLOv5 模型在同一数据集上进行训练。也对 YOLOv5 使用相同的标签文件。

    ssh root@<ip-addr of the target device>aCopy to clipboard

    cp /opt/yolonas.labels /opt/yolov5.labelsCopy to clipboard

- **[TensorFlow Lite 用例](https://docs.qualcomm.com/doc/80-70015-50SC/topic/tensorflow-lite-use-cases.html)**  

TensorFlow Lite 是一套可帮助开发人员在移动、嵌入式和边缘设备上运行模型，从而实现设备端机器学习的工具。借助 TensorFlow lite 用例，可以运行图像分类、目标检测、图像分割和姿态估计的用例。
- **[Qualcomm Neural Processing SDK 用例](https://docs.qualcomm.com/doc/80-70015-50SC/topic/qualcomm-neural-processing-sdk-use-cases.html)**  

Qualcomm Neural Processing SDK（原称为 Qualcomm Snapdragon Neural Processing Engine (SNPE)）用于运行深度神经网络进行推理。这些用例描述了使用不同 ML 模型的图像分类、目标检测和图像分割场景。

**Parent Topic:** [GStreamer 命令行用例](https://docs.qualcomm.com/doc/80-70015-50SC/topic/gstreamer-application-use-cases.html)

Last Published: Nov 11, 2025

[Previous Topic
GStreamer 命令行用例](https://docs.qualcomm.com/bundle/publicresource/80-70015-50SC/topics/gstreamer-application-use-cases.md) [Next Topic
TensorFlow Lite 用例](https://docs.qualcomm.com/bundle/publicresource/80-70015-50SC/topics/tensorflow-lite-use-cases.md)