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

sample_object_segmentation 管道流程

下图展示了 sample_object_segmentation 的管道流程。
Object segmentation pipeline from camera capture through YOLO preprocessing, inference, postprocessing, and overlay to the segmentation result.

sample_object_segmentation 管道。

sample_object_segmentation 管道中使用的 ROS 节点

下表列出了 sample_object_segmentation 管道中使用的 ROS 节点。

sample_object_segmentation 中使用的 ROS 话题

下表列出了 sample_object_segmentation 管道中使用的 ROS 话题。

前提条件

  • 你已根据安装 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_segmentation

在设备上,运行示例应用:
Run the sample application
现在,你可以在 rviz2 中查看名为 /yolo_segment_overlay 的 ROS 话题。

从源码构建 sample_object_segmentation

在执行以下步骤之前,请确保先运行前提条件。
1

从 qrb_ros_samples 仓库下载源码

Download the source code
2

从源码构建 sample_sample_segmentation 示例应用

Build the sample application
3

运行并测试示例应用

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