This is a ROS2 package that implements a ready-to-use object detection node. It takes in input images and publishes information about the detected objects in the image providing the bounding box and the object class. It PyTorch technology to perform object detection, by default it uses YOLOv7-tiny model trained with the COCO dataset.
ros2 launch image_object_detection image_object_detection_launch.py
- image: A topic that publishes raw images. Subscribed to using the sensor_msgs.msg.Image message type.
- image/compressed: A topic that publishes compressed images. Subscribed to using the sensor_msgs.msg.CompressedImage message type.
- detections: A topic that publishes object detections. Published using the vision_msgs.msg.Detection2DArray message type.
- debug_image: A topic that publishes a debug image with detections drawn on it. Published using the Image message type if the param
publish_debug_image
is set to True.
- model.image_size: The size of the input image to the model. Default value is 640.
- model.confidence: The minimum confidence threshold for object detection. Default value is 0.25.
- model.iou_threshold: The IoU (Intersection over Union) threshold for overlapping detections. Default value is 0.45.
- model.weights_file: The path to the model weights file. Default value is yolov7-tiny.pt in the package share directory.
- model.device: The device to run the model on, e.g. CPU or GPU. Default value is an empty string.
- show_image: A flag to indicate whether to display the input image. Default value is False.
- publish_debug_image: A flag to indicate whether to publish a debug image with detections drawn on it. Default value is True.
- image_debug_publisher.qos_policy: The QoS policy for the debug_image topic. Default value is best_effort.
- subscribers.qos_policy: The QoS policy for the input topics topic. Default value is best_effort.
- Author: Pablo Iñigo Blasco ([email protected]) - Intelligent Behavior Robots
- License: BSDv3