Skip to main content
Ultralytics YOLOv8 is a machine learning model that predicts bounding boxes, segmentation masks and classes of objects in an image.

sample_object_segmentation pipeline flow

The following figure shows the pipeline flow for sample_object_segmentation.
Object segmentation pipeline from camera capture through YOLO preprocessing, inference, postprocessing, and overlay to the segmentation result.

sample_object_segmentation pipeline.

ROS nodes used in the sample_object_segmentation pipeline

The following table lists the ROS nodes used in the sample_object_segmentation pipeline.

ROS topics used in the sample_object_segmentation

The following table lists the ROS topics used in the sample_object_segmentation pipeline.

Prerequisites

  • You have set up the device, installed ROS2 Jazzy and Qualcomm Intelligent Robotics (QIR) SDK on the device according to Install the QIR SDK.
  • On the host computer, you have downloaded and built the yolo model according to steps in the README of qrb_ros_tensor_process.
    When downloading the yolo model, use target-runtime and device as follows:

Generate YOLOv8 model

1

Set up the QAI-Hub on the host computer.

a. Sign in to QAI-Hub and get your API token.b. Install QAI-Hub on the host computer.
2

Export the model on the host computer.

After executing the following commands, the model file and coco8.yaml are generated in the host computer.

Run out-of-the-box sample_object_segmentation

On the device, run the sample application:
Run the sample application
Now, you can check ROS topics with the name /yolo_segment_overlay in rviz2.

Build from the source of sample_object_segmentation

Ensure that you run the Prerequisites first before performing the following steps.
1

Download the source code from the qrb_ros_samples repository

Download the source code
2

Build the sample_sample_segmentation sample application from the source code

Build the sample application
3

Run and test the sample application

Run and test according to steps 2–3 of Run out-of-the-box sample_object_segmentation.