Skip to main content
下图展示了图像分类结果的示例。
Live camera view of sunglasses with a pink label and a terminal window echoing the classification result on the /resnet101_output topic.

图像分类结果。

ResNet101 是一个可以对 ImageNet 数据集图像进行分类的机器学习模型。它也可以作为构建针对特定用例的更复杂模型的基础网络。

图像分类管线流程

下图展示了图像分类示例应用的管线流程。
Image classification pipeline running from camera capture and image publishing through preprocessing, inference, and postprocessing to labeled output.

图像分类管线。

图像分类管线中使用的 ROS 节点

下表列出了图像分类管线中使用的 ROS 节点。

图像分类管线中使用的 ROS topic

下表列出了图像分类管线中使用的 ROS topic。

前提条件

您已根据 安装 QIR SDK 在设备上完成设备设置、安装 ROS2 Jazzy 和 Qualcomm Intelligent Robotics (QIR) SDK。

运行开箱即用的图像分类

1

安装图像分类软件包

Install the packages
2

在设备上设置示例环境

Launch the sample application
launch_with_image_publisher.py 启动脚本使用以下默认参数:
a. 它发送 local glasses.jpg 文件,并以 10 Hz 的频率输出图像。b. 然后,您可以在另一个 shell 终端中使用 name/resnet101_output 检查 ROS topic。
Output

从源代码构建图像分类

当您需要修改示例代码时,可以从源代码构建图像分类示例。设备端步骤包括安装依赖项、克隆源代码仓库并构建软件包。

设备端步骤

1

安装依赖项

Install the dependencies
2

从 qrb_ros_samples 仓库下载源代码

3

从源代码构建 object_detection 示例应用

Build the sample application
4

运行并测试示例应用

根据 运行开箱即用的图像分类 的第 2 步运行并测试。