Skip to main content
The sample_object_segmentation sample application detects and segments objects in images using ROS 2 nodes. It uses Qualcommยฎ AI Engine Direct SDK (QNN) for model inference. The sample application uses the Ultralytics YOLOv8 model to predict bounding boxes, segmentation masks, and classes of objects in an image.
NoteFor more information, see sample_object_segmentation on GitHub.

Figure: Sample effects of sample_object_segmentation

Pipeline flow for sample_object_segmentation

Figure: Pipeline flow for sample_object_segmentation

ROS nodes used in sample_object_segmentation

ROS topics used in sample_object_segmentation

Noteyolo_segment_overlay_node synchronizes two inputs, /yolo_segment_result and /resized_image, using an exact-time policy. Both must be publishing for /yolo_segment_overlay to be produced.

Prerequisites

Generate YOLOv8 model

  1. Set up QAI-Hub on the host computer.
    1. Sign in to QAI-Hub and get your API token.
    2. Install QAI-Hub.
  2. Export the model on the host computer.
    SSH Session
For more information, see qrb_ros_tensor_process on GitHub.

Run out-of-the-box sample_object_segmentation

1

Run the sample on the development kit

SSH Session
2

Check the results on the host computer

In a terminal of the host computer, check the ROS topics with the name /yolo_segment_overlay in rqt.

Build and run sample_object_segmentation

The following steps build the sample_object_segmentation package using Dragonwing IQ-9075 Evaluation Kit as an example.
1

Build and package on the host computer

  1. Build the sample application project.
  2. Package and push the sample application to the device.
2

Install and run on the development kit

  1. Install the sample application.
    SSH Session
  2. Run the sample application with the steps in Run out-of-the-box sample_object_segmentation.