yolo_ros

Ultralytics YOLOv8, YOLOv9, YOLOv10, YOLOv11, YOLOv12 for ROS 2

https://github.com/mgonzs13/yolo_ros

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.5%) to scientific vocabulary

Keywords

3d-human-pose-estimation 3d-object-detection human-pose-estimation instance-segmentation obb object-detection object-tracking oriented-bounding-box ros2 ultralytics yolo yoloe yolov10 yolov11 yolov12 yolov8 yolov9
Last synced: 4 months ago · JSON representation ·

Repository

Ultralytics YOLOv8, YOLOv9, YOLOv10, YOLOv11, YOLOv12 for ROS 2

Basic Info
  • Host: GitHub
  • Owner: mgonzs13
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 2.7 MB
Statistics
  • Stars: 789
  • Watchers: 6
  • Forks: 186
  • Open Issues: 2
  • Releases: 27
Topics
3d-human-pose-estimation 3d-object-detection human-pose-estimation instance-segmentation obb object-detection object-tracking oriented-bounding-box ros2 ultralytics yolo yoloe yolov10 yolov11 yolov12 yolov8 yolov9
Created almost 3 years ago · Last pushed 5 months ago
Metadata Files
Readme License Citation

README.md

yolo_ros

ROS 2 wrap for YOLO models from Ultralytics to perform object detection and tracking, instance segmentation, human pose estimation and Oriented Bounding Box (OBB). There are also 3D versions of object detection, including instance segmentation, and human pose estimation based on depth images.

[![License: MIT](https://img.shields.io/badge/GitHub-GPL--3.0-informational)](https://opensource.org/license/gpl-3-0) [![GitHub release](https://img.shields.io/github/release/mgonzs13/yolo_ros.svg)](https://github.com/mgonzs13/yolo_ros/releases) [![Code Size](https://img.shields.io/github/languages/code-size/mgonzs13/yolo_ros.svg?branch=main)](https://github.com/mgonzs13/yolo_ros?branch=main) [![Dependencies](https://img.shields.io/librariesio/github/mgonzs13/yolo_ros?branch=main)](https://libraries.io/github/mgonzs13/yolo_ros?branch=main) [![Last Commit](https://img.shields.io/github/last-commit/mgonzs13/yolo_ros.svg)](https://github.com/mgonzs13/yolo_ros/commits/main) [![GitHub issues](https://img.shields.io/github/issues/mgonzs13/yolo_ros)](https://github.com/mgonzs13/yolo_ros/issues) [![GitHub pull requests](https://img.shields.io/github/issues-pr/mgonzs13/yolo_ros)](https://github.com/mgonzs13/yolo_ros/pulls) [![Contributors](https://img.shields.io/github/contributors/mgonzs13/yolo_ros.svg)](https://github.com/mgonzs13/yolo_ros/graphs/contributors) [![Python Formatter Check](https://github.com/mgonzs13/yolo_ros/actions/workflows/python-formatter.yml/badge.svg?branch=main)](https://github.com/mgonzs13/yolo_ros/actions/workflows/python-formatter.yml?branch=main) | ROS 2 Distro | Branch | Build status | Docker Image | Documentation | | :----------: | :------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Humble** | [`main`](https://github.com/mgonzs13/yolo_ros/tree/main) | [![Humble Build](https://github.com/mgonzs13/yolo_ros/actions/workflows/humble-docker-build.yml/badge.svg?branch=main)](https://github.com/mgonzs13/yolo_ros/actions/workflows/humble-docker-build.yml?branch=main) | [![Docker Image](https://img.shields.io/badge/Docker%20Image%20-humble-blue)](https://hub.docker.com/r/mgons/yolo_ros/tags?name=humble) | [![Doxygen Deployment](https://github.com/mgonzs13/yolo_ros/actions/workflows/doxygen-deployment.yml/badge.svg)](https://mgonzs13.github.io/yolo_ros/latest) | | **Iron** | [`main`](https://github.com/mgonzs13/yolo_ros/tree/main) | [![Iron Build](https://github.com/mgonzs13/yolo_ros/actions/workflows/iron-docker-build.yml/badge.svg?branch=main)](https://github.com/mgonzs13/yolo_ros/actions/workflows/iron-docker-build.yml?branch=main) | [![Docker Image](https://img.shields.io/badge/Docker%20Image%20-iron-blue)](https://hub.docker.com/r/mgons/yolo_ros/tags?name=iron) | [![Doxygen Deployment](https://github.com/mgonzs13/yolo_ros/actions/workflows/doxygen-deployment.yml/badge.svg)](https://mgonzs13.github.io/yolo_ros/latest) | | **Jazzy** | [`main`](https://github.com/mgonzs13/yolo_ros/tree/main) | [![Jazzy Build](https://github.com/mgonzs13/yolo_ros/actions/workflows/jazzy-docker-build.yml/badge.svg?branch=main)](https://github.com/mgonzs13/yolo_ros/actions/workflows/jazzy-docker-build.yml?branch=main) | [![Docker Image](https://img.shields.io/badge/Docker%20Image%20-jazzy-blue)](https://hub.docker.com/r/mgons/yolo_ros/tags?name=jazzy) | [![Doxygen Deployment](https://github.com/mgonzs13/yolo_ros/actions/workflows/doxygen-deployment.yml/badge.svg)](https://mgonzs13.github.io/yolo_ros/latest) | | **Kilted** | [`main`](https://github.com/mgonzs13/yolo_ros/tree/main) | [![Kilted Build](https://github.com/mgonzs13/yolo_ros/actions/workflows/kilted-docker-build.yml/badge.svg?branch=main)](https://github.com/mgonzs13/yolo_ros/actions/workflows/kilted-docker-build.yml?branch=main) | [![Docker Image](https://img.shields.io/badge/Docker%20Image%20-kilted-blue)](https://hub.docker.com/r/mgons/yolo_ros/tags?name=kilted) | [![Doxygen Deployment](https://github.com/mgonzs13/yolo_ros/actions/workflows/doxygen-deployment.yml/badge.svg)](https://mgonzs13.github.io/yolo_ros/latest) | | **Rolling** | [`main`](https://github.com/mgonzs13/yolo_ros/tree/main) | [![Rolling Build](https://github.com/mgonzs13/yolo_ros/actions/workflows/rolling-docker-build.yml/badge.svg?branch=main)](https://github.com/mgonzs13/yolo_ros/actions/workflows/rolling-docker-build.yml?branch=main) | [![Docker Image](https://img.shields.io/badge/Docker%20Image%20-rolling-blue)](https://hub.docker.com/r/mgons/yolo_ros/tags?name=rolling) | [![Doxygen Deployment](https://github.com/mgonzs13/yolo_ros/actions/workflows/doxygen-deployment.yml/badge.svg)](https://mgonzs13.github.io/yolo_ros/latest) |

Table of Contents

  1. Installation
  2. Docker
  3. Models
  4. Usage
  5. Demos

Installation

shell cd ~/ros2_ws/src git clone https://github.com/mgonzs13/yolo_ros.git pip3 install -r yolo_ros/requirements.txt cd ~/ros2_ws rosdep install --from-paths src --ignore-src -r -y colcon build

Docker

Build the yolo_ros docker.

shell docker build -t yolo_ros .

Run the docker container. If you want to use CUDA, you have to install the NVIDIA Container Tollkit and add --gpus all.

shell docker run -it --rm --gpus all yolo_ros

Models

The compatible models for yolo_ros are the following:

Usage

Click to expand ### YOLOv5 ```shell ros2 launch yolo_bringup yolov5.launch.py ``` ### YOLOv8 ```shell ros2 launch yolo_bringup yolov8.launch.py ``` ### YOLOv9 ```shell ros2 launch yolo_bringup yolov9.launch.py ``` ### YOLOv10 ```shell ros2 launch yolo_bringup yolov10.launch.py ``` ### YOLOv11 ```shell ros2 launch yolo_bringup yolov11.launch.py ``` ### YOLOv12 ```shell ros2 launch yolo_bringup yolov12.launch.py ``` ### YOLO-World ```shell ros2 launch yolo_bringup yolo-world.launch.py ``` ### YOLOE ```shell ros2 launch yolo_bringup yoloe.launch.py ```

Topics

  • /yolo/detections: Objects detected by YOLO using the RGB images. Each object contains a bounding box and a class name. It may also include a mark or a list of keypoints.
  • /yolo/tracking: Objects detected and tracked from YOLO results. Each object is assigned a tracking ID.
  • /yolo/detections_3d: 3D objects detected. YOLO results are used to crop the depth images to create the 3D bounding boxes and 3D keypoints.
  • /yolo/debug_image: Debug images showing the detected and tracked objects. They can be visualized with rviz2.

Parameters

These are the parameters from the yolo.launch.py, used to launch all models. Check out the Ultralytics page for more details.

  • model_type: Ultralytics model type (default: YOLO)
  • model: YOLO model (default: yolov8m.pt)
  • tracker: tracker file (default: bytetrack.yaml)
  • device: GPU/CUDA (default: cuda:0)
  • yolo_encoding: Encoding to convert input image before using YOLO (default: bgr8)
  • enable: whether to start YOLO enabled (default: True)
  • threshold: detection threshold (default: 0.5)
  • iou: intersection Over Union (IoU) threshold for Non-Maximum Suppression (NMS) (default: 0.7)
  • imgsz_height: image height for inference (default: 480)
  • imgsz_width: image width for inference (default: 640)
  • half: whether to enable half-precision (FP16) inference speeding up model inference with minimal impact on accuracy (default: False)
  • max_det: maximum number of detections allowed per image (default: 300)
  • augment: whether to enable test-time augmentation (TTA) for predictions improving detection robustness at the cost of speed (default: False)
  • agnostic_nms: whether to enable class-agnostic Non-Maximum Suppression (NMS) merging overlapping boxes of different classes (default: False)
  • retina_masks: whether to use high-resolution segmentation masks if available in the model, enhancing mask quality for segmentation (default: False)
  • inputimagetopic: camera topic of RGB images (default: /camera/rgb/image_raw)
  • image_reliability: reliability for the image topic: 0=system default, 1=Reliable, 2=Best Effort (default: 1)
  • inputdepthtopic: camera topic of depth images (default: /camera/depth/image_raw)
  • depthimagereliability: reliability for the depth image topic: 0=system default, 1=Reliable, 2=Best Effort (default: 1)
  • inputdepthinfo_topic: camera topic for info data (default: /camera/depth/camera_info)
  • depthinforeliability: reliability for the depth info topic: 0=system default, 1=Reliable, 2=Best Effort (default: 1)
  • target_frame: frame to transform the 3D boxes (default: base_link)
  • depthimageunits_divisor: divisor to convert the depth image into meters (default: 1000)
  • maximumdetectionthreshold: maximum detection threshold in the z-axis (default: 0.3)
  • use_tracking: whether to activate tracking after detection (default: True)
  • use_3d: whether to activate 3D detections (default: False)
  • use_debug: whether to activate debug node (default: True)

Lifecycle Nodes

Previous updates add Lifecycle Nodes support to all the nodes available in the package. This implementation tries to reduce the workload in the unconfigured and inactive states by only loading the models and activating the subscriber on the active state.

These are some resource comparisons using the default yolov8m.pt model on a 30fps video stream.

| State | CPU Usage (i7 12th Gen) | VRAM Usage | Bandwidth Usage | | -------- | ----------------------- | ---------- | --------------- | | Active | 40-50% in one core | 628 MB | Up to 200 Mbps | | Inactive | ~5-7% in one core | 338 MB | 0-20 Kbps |

YOLO 3D

shell ros2 launch yolo_bringup yolov8.launch.py use_3d:=True

Demos

Object Detection

This is the standard behavior of yolo_ros which includes object tracking.

shell ros2 launch yolo_bringup yolo.launch.py

Instance Segmentation

Instance masks are the borders of the detected objects, not all the pixels inside the masks.

shell ros2 launch yolo_bringup yolo.launch.py model:=yolov8m-seg.pt

Human Pose

Online persons are detected along with their keypoints.

shell ros2 launch yolo_bringup yolo.launch.py model:=yolov8m-pose.pt

3D Object Detection

The 3D bounding boxes are calculated by filtering the depth image data from an RGB-D camera using the 2D bounding box. Only objects with a 3D bounding box are visualized in the 2D image.

shell ros2 launch yolo_bringup yolo.launch.py use_3d:=True

3D Object Detection (Using Instance Segmentation Masks)

In this, the depth image data is filtered using the max and min values obtained from the instance masks. Only objects with a 3D bounding box are visualized in the 2D image.

shell ros2 launch yolo_bringup yolo.launch.py model:=yolov8m-seg.pt use_3d:=True

3D Human Pose

Each keypoint is projected in the depth image and visualized using purple spheres. Only objects with a 3D bounding box are visualized in the 2D image.

shell ros2 launch yolo_bringup yolo.launch.py model:=yolov8m-pose.pt use_3d:=True

Owner

  • Name: Miguel Ángel González Santamarta
  • Login: mgonzs13
  • Kind: user
  • Location: León
  • Company: University of León

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: "González-Santamarta"
    given-names: "Miguel Á."
title: "yolo_ros"
date-released: 2023-02-21
url: "https://github.com/mgonzs13/yolo_ros"

GitHub Events

Total
  • Create event: 8
  • Issues event: 73
  • Release event: 6
  • Watch event: 405
  • Issue comment event: 210
  • Push event: 27
  • Pull request event: 18
  • Fork event: 90
Last Year
  • Create event: 8
  • Issues event: 73
  • Release event: 6
  • Watch event: 405
  • Issue comment event: 210
  • Push event: 27
  • Pull request event: 18
  • Fork event: 90

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 132
  • Total Committers: 8
  • Avg Commits per committer: 16.5
  • Development Distribution Score (DDS): 0.182
Past Year
  • Commits: 58
  • Committers: 6
  • Avg Commits per committer: 9.667
  • Development Distribution Score (DDS): 0.086
Top Committers
Name Email Commits
Miguel Ángel González Santamarta m****s@u****s 108
adamwhats a****s@m****m 11
agonzc34 a****4@e****s 8
zero d****7@g****m 1
talhagulbudak 5****k 1
Hashaam Zafar 6****7 1
Erich L Foster e****f@g****m 1
Andreas a****7@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 71
  • Total pull requests: 20
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 2 days
  • Total issue authors: 63
  • Total pull request authors: 13
  • Average comments per issue: 6.28
  • Average comments per pull request: 1.2
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 34
  • Pull requests: 13
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 3 days
  • Issue authors: 29
  • Pull request authors: 10
  • Average comments per issue: 3.88
  • Average comments per pull request: 1.62
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Phance (5)
  • ArghyaChatterjee (2)
  • racket405 (2)
  • YumTaha (2)
  • ZGregorio (1)
  • Shua1ge (1)
  • Peanpepu (1)
  • robohase (1)
  • hemsinghb (1)
  • Ragnar7982 (1)
  • KoaBou (1)
  • agillies8 (1)
  • shiven2001 (1)
  • arun-venkat-23 (1)
  • prakash-aryan (1)
Pull Request Authors
  • agonzc34 (3)
  • daohu527 (2)
  • mgonzs13 (2)
  • talhagulbudak (2)
  • liamcarlos (2)
  • agillies8 (2)
  • hashaam1217 (2)
  • adamwhats (2)
  • jhihdewu (1)
  • redvinaa (1)
  • erichlf (1)
  • andreaslutsch (1)
  • birneamstiel (1)
  • hifzhil (1)
Top Labels
Issue Labels
stale (16)
Pull Request Labels