Skip to content

YOLO_ros - ROS2 wrapper for Yolov7 and Yolov8

License

Notifications You must be signed in to change notification settings

Rudiio/yolo_ros2-isir

 
 

Repository files navigation

YOLO ROS2

This is a ROS2 package that adapt Real-time objects detetor on ROS2. It is based on Yolos object detector. The two supported models are Yolov7 and Yolov8. Yolov7 relies on this paper and the code for the model is originated from the official implementation. The integration of yolov8 uses the official package of ultralytics.

The pre-trained weigths were taken from the official repositories and you can have more informations about the training on the official repositories.

It was tested on Ubuntu 22 and ROS2 Humble.

Installation

This package also uses a special interfaces that encodes 2 ROS2 messages:

# detection confidence
float32 conf

# Object corners
uint16 x1
uint16 y1
uint16 x2
uint16 y2

# Object label
string label

# Object color
uint16[] color

# Position available
bool pos_available

# Object centroid position
float32[3] position
# Headers
std_msgs/Header header
std_msgs/Header image_header

# Image Dimensions
uint16 img_width
uint16 img_heigth

# List of Bounding boxes
BoundingBox[] bboxes

To install :

# cloning the repo into the ROS2 workspace
git clone https://github.com/Rudiio/yolo_ros2-isir.git

# Installing the requirements
pip install -r requirements.txt
pip install ultralytics

# building the package
colcon build

Usage

When you use the package, you need to give it parameters :

  • the publishing topic
  • the weigth path
  • the model ('yolov7' or 'yolov8')

For example, in a launch file :

launch_ros.actions.Node(
            package='yolov7',
            executable='yolov7',
            name='yolov8_empty_seats',
            parameters=[{'weigth' : 'src/yolov7/weigths/empty_seats_yolov8.pt'},
                        {'topic' : 'bboxes/empty_seats'},
                        {'model' : 'yolov8'}]),

The input topic (to suscribe) can be changed by remapping this topic : '/zed2/zed_node/rgb/image_rect_color'

Citation

@article{wang2022yolov7,
  title={{YOLOv7}: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors},
  author={Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},
  journal={arXiv preprint arXiv:2207.02696},
  year={2022}
}
@article{wang2022designing,
  title={Designing Network Design Strategies Through Gradient Path Analysis},
  author={Wang, Chien-Yao and Liao, Hong-Yuan Mark and Yeh, I-Hau},
  journal={arXiv preprint arXiv:2211.04800},
  year={2022}
}

Acknowledgements

Expand

About

YOLO_ros - ROS2 wrapper for Yolov7 and Yolov8

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.4%
  • Other 0.6%