sample_object_detection 示例应用使用 ROS 2 节点检测并分类图像中的物体。它使用 Qualcomm® AI Engine Direct SDK (QNN) 进行模型推理。
该示例使用 Ultralytics YOLOv8 模型来预测图像中物体的边界框和类别。
注意有关更多信息,请参见 GitHub 上的 sample_object_detection。
图:sample_object_detection 的示例效果
sample_object_detection 的流水线流程
图:sample_object_detection 的流水线流程
sample_object_detection 中使用的 ROS 节点
sample_object_detection 中使用的 ROS topic
注意
yolo_detection_overlay_node 使用严格时间戳(exact-time)策略同步 /yolo_detect_result 和 /resized_image 两个输入。两者都必须处于发布状态,才能产生 /yolo_detect_overlay。前提条件
- 你已完成 设置运行示例应用的环境 中的设置。
- 你已按以下步骤在主机计算机上使用 QAI-Hub 生成了 YOLOv8 模型。
生成 YOLOv8 模型
- 在主机计算机上设置 QAI-Hub。
- 登录 QAI-Hub 并获取你的 API token。
- 安装 QAI-Hub。
- 在主机计算机上导出模型。
SSH Session
开箱即用运行 sample_object_detection
构建并运行 sample_object_detection
以下步骤以 Dragonwing IQ-9075 Evaluation Kit 为例构建 sample_object_detection 包。
试一试
试一试
1
在主机计算机上构建并打包
- 构建示例应用项目。
- 打包并将示例应用推送到设备。
2
在开发套件上安装并运行
- 安装示例应用。
SSH Session
- 按照 开箱即用运行 sample_object_detection 中的步骤运行示例应用。

