Skip to main content
Ultralytics YOLOv8 是一个可以预测图像中目标边界框、分割掩膜和类别的机器学习模型。

sample_object_detection 的管线流程

下图展示了 sample_object_detection 的管线流程。
Object detection pipeline from camera capture through YOLO preprocessing, inference, postprocessing, and overlay to the detection result topic.

sample_object_detection 的管线流程。

sample_object_detection 管线中使用的 ROS 节点

下表列出了 sample_object_detection 管线中使用的 ROS 节点。

sample_object_detection 管线中使用的 ROS topic

下表列出了 sample_object_detection 管线中使用的 ROS topic。

前提条件

  • 您已根据 安装 QIR SDK 在设备上完成设备设置、安装 ROS2 Jazzy 和 Qualcomm Intelligent Robotics (QIR) SDK。
  • 在主机上,您已根据 qrb_ros_tensor_process 的 README 中的步骤下载并构建了 yolo 模型。
    下载 yolo 模型时,使用如下 target-runtime 和 device:

生成 YOLOv8 模型

1

在主机上设置 QAI-Hub。

a. 登录 QAI-Hub 并获取您的 API token。b. 在主机上安装 QAI-Hub。
2

在主机上导出模型。

执行以下命令后,模型文件和 coco8.yaml 将在主机上生成。

运行开箱即用的 sample_object_detection

在设备上,运行示例应用:
Run the sample application
然后,您可以在 rviz2 中查看名为 /yolo_detect_overlay 的 ROS topic。

从 sample_object_detection 的源代码构建

请先运行 前提条件,然后再执行以下步骤。
在设备上,运行示例应用:
1

从 qrb_ros_samples 仓库下载源代码

Download the source code
2

从源代码构建 sample_object_detection 示例应用

Build the sample application
3

运行并测试示例应用

根据 运行开箱即用的 sample_object_detection 的第 2–3 步运行并测试。