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_detection pipeline flow

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

Pipeline flow for sample_object_detection.

ROS nodes used in the sample_object_detection pipeline

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

ROS topics used in the sample_object_detection pipeline

The following table lists the ROS topics used in the sample_object_detection 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_detection

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

Build from the source of sample_object_detection

Ensure that you run the Prerequisites first before performing the following steps.
On the device, run the sample application:
1

Download the source code from the qrb_ros_samples repository

Download the source code
2

Build the sample_object_detection 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_detection.