greenhouse/README.md
Shane Loretz 9740b6209f
Initial package (#1)
* Initial package

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Use latest vision_msgs with string id

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Tiny improvements

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Add parser tests and ignore blank lines in class names

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Test when cfg file does not exist

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Rename test

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* openrobotics_darknet_ros -> openrobotics::darknet_ros

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Added visibility files

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Rename files

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* darknet_node -> detector_node

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Rename files

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Rename files

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* DetectorNetwork and DetectorNode

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Simple readme

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Add Example section

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Example actually works

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Fix link

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Linter tests pass

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
2019-10-04 14:59:05 -07:00

1.8 KiB

Open Robotics Darknet ROS

This is a ROS 2 wrapper around darknet, an open source neural network framework.

Example image with bounding boxes created using darknet and the yolov3-tiny network

DetectorNode

This node can run object detectors like YOLOv3 on images.

Subscribers

  • ~/images (type sensor_msgs/msg/Image) - Input mages to feed to the detector

Publishers

  • ~/detections (type vision_msgs/msg/Detection2DArray) - Objects detected in an image (if any)

Parameters

  • network.config - a path to a file describing a darknet detector network
  • network.weights - a path to a file with weights for the given network
  • network.class_names - a path to a file with names of classes the network can detect (1 per line)
  • detection.threshold - Minimum probability of a detection to be published
  • detection.nms_threshold - Non-maximal Suppression threshold - controls filtering of overlapping boxes

Example

Download YOLOv3-tiny.

wget https://raw.githubusercontent.com/pjreddie/darknet/f86901f6177dfc6116360a13cc06ab680e0c86b0/cfg/yolov3-tiny.cfg
wget https://pjreddie.com/media/files/yolov3-tiny.weights
wget https://raw.githubusercontent.com/pjreddie/darknet/c6afc7ff1499fbbe64069e1843d7929bd7ae2eaa/data/coco.names

Save the following as detector_node_params.yaml

/**:
  ros__parameters:
    network:
      config: "./yolov3-tiny.cfg"
      weights: "./yolov3-tiny.weights"
      class_names: "./coco.names"
    detection:
      threshold: 0.25
      nms_threshold: 0.45

Then run the node.

ros2 run openrobotics_darknet_ros detector_node __params:=detector_node_params.yaml

The node is now running. Publish images on ~/images to get the node to detect objects.