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

Figure: Sample effects of sample_object_detection

Pipeline flow for sample_object_detection

Figure: Pipeline flow for sample_object_detection

ROS nodes used in sample_object_detection

ROS topics used in sample_object_detection

Noteyolo_detection_overlay_node synchronizes two inputs, /yolo_detect_result and /resized_image, using an exact-time policy. Both must be publishing for /yolo_detect_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_detection

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_detect_overlay in rqt.

Build and run sample_object_detection

The following steps build the sample_object_detection 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_detection.