Compact object detection capability for ROS2. As an object detector, YOLO is implemented via DNN module of OpenCV.
- In regard of Darknet support of OpenCV, this package supports YOLOv2 to v4 and also corresponding Tiny YOLO versions.
- All necessary parameters are stored in a Launch File
- Prediction results are published in two different ways.
- In a custom ROS message
- In a human readable form as an
Image
Topic Name | Message Type |
---|---|
camera/yolo |
Image |
yolo/array |
YoloMsgArray |
Topic Name | Message Type |
---|---|
camera/image_undist_color |
CompressedImage |
- OpenCV
To install:$ python3 -m pip install opencv-python
- CvBridge
To install:$ sudo apt install ros-eloquent-cv-bridge
- yolo_msg
To install:
Clone repository to/your_workspace/src
Then, build your workspace$ git clone https://git.fh-aachen.de/kurhan/yolo_msg.git
$ colcon build
- camera_rgb or an alternative image publisher package
To install:
Clone repository to/your_workspace/src
Then, build your workspace$ git clone https://git.fh-aachen.de/kurhan/camera_rgb.git
$ colcon build
- Clone repository to
/your_workspace/src
$ git clone https://git.fh-aachen.de/kurhan/yolo_in_ros.git
- Build
/your_workspace
withcolcon
$ colcon build
It consist of parameters specific to YOLO
-
config_file
contains structure of YOLO and hyperparameters.-
.cfg
file - It must be under
yolo_in_ros/config/
-
-
model_file
contains weights/parameters obtained during trained.-
.weight
file - It must be under
yolo_in_ros/config/
-
-
class_file
contains object names that YOLO CNN is trained for.- It must be a
.txt
file. - One class per line.
- It must be under
yolo_in_ros/config/
- It must be a
-
conf_thresh_val
set the threshold to eliminate predictions with low score. -
nms_threshold
sets the threshold of Non-maximum Supression which eliminates predictions with low confidence score for same objects. -
width
andheight
set the size of input image of CNN and they must be multiple of 32. -
scale
is a factor which converts 8-bit($[0, 255]$ ) pixel values to floating numbers in a range of$[0, 1.0]$ -
color
indicates that input image has 3 layers(RGB).
- Files of pretrained YOLO can be found here and there
- For this ROS package the files of Tiny YOLOv4, which is trained by current developers with COCO dataset, are supplied.