Home

Awesome

ros2_openvino_toolkit

Table of Contents

Overview

ROS2 Version Supported

Branch NameROS2 Version SupportedOpenvino VersionOS Version
ros2Galactic, Foxy, HumbleV2022.1, V2022.2, V2022.3Ubuntu 20.04, Ubuntu 22.04
dashingDashingV2022.1, V2022.2, V2022.3Ubuntu 18.04
foxy-ov2021.4FoxyV2021.4Ubuntu 20.04
galactic-ov2021.4GalacticV2021.4Ubuntu 20.04

Inference Features Supported

Prerequisite

PrerequisiteMandatory?Description
ProcessorMandatoryA platform with Intel processors assembled. (Refer to here for the full list of Intel processors supported.)
OSMandatoryWe only tested this project under Ubuntu distros. It is recommended to install the corresponding Ubuntu Distro according to the ROS distro that you select to use. For example: Ubuntu 18.04 for dashing, Ubuntu 20.04 for Foxy and Galactic, Ubuntu 22.04 for Humble.
ROS2MandatoryWe have already supported active ROS distros (Humble, Galactic, Foxy and Dashing (deprecated)). Choose the one matching your needs. You may find the corresponding branch from the table above in section ROS2 Version Supported.
OpenVINOMandatoryThe version of OpenVINO toolkit is decided by the OS and ROS2 distros you use. See the table above in Section ROS2 Version Supported.
Realsense CameraOptionalRealsense Camera is optional, you may choose these alternatives as the input: Standard Camera, ROS Image Topic, Video/Image File or RTSP camera.

Introduction

Design Architecture

From the view of hirarchical architecture design, the package is divided into different functional components, as shown in below picture.

OpenVINO_Architecture

<p> <details> <summary>Intel® OpenVINO™ toolkit</summary> </details> </p> <p> <details> <summary>ROS OpenVINO Runtime Framework</summary> </details> </p> <p> <details> <summary>ROS Input & Output</summary> </details> </p> <p> <details> <summary>Optimized Models</summary> </details> </p>

Logic Flow

From the view of logic implementation, the package introduces the definitions of parameter manager, pipeline and pipeline manager. The following picture depicts how these entities co-work together when the corresponding program is launched.

Logic_Flow

Once a corresponding program is launched with a specified .yaml config file passed in the .launch file or via commandline, parameter manager analyzes the configurations about pipeline and the whole framework, then shares the parsed configuration information with pipeline procedure. A pipeline instance is created by following the configuration info and is added into pipeline manager for lifecycle control and inference action triggering.

The contents in .yaml config file should be well structured and follow the supported rules and entity names. Please see yaml configuration guidance for how to create or edit the config files.

<p> <details> <summary>Pipeline</summary>

Pipeline fulfills the whole data handling process: initiliazing Input Component for image data gathering and formating; building up the structured inference network and passing the formatted data through the inference network; transfering the inference results and handling output, etc.

</details> </p> <p> <details> <summary>Pipeline manager</summary>

Pipeline manager manages all the created pipelines according to the inference requests or external demands (say, system exception, resource limitation, or end user's operation). Because of co-working with resource management and being aware of the whole framework, it covers the ability of performance optimization by sharing system resource between pipelines and reducing the burden of data copy.

</details> </p>

Supported Features

Multiple Input Components

Currently, the package supports several input resources for acquiring image data. The following tables are listed:

<p> <details> <summary>Input Resource Table</summary>
Input ResourceDescription
StandardCameraAny RGB camera with USB port supporting. Currently only the first USB camera if many are connected.
RealSenseCameraIntel RealSense RGB-D Camera, directly calling RealSense Camera via librealsense plugin of openCV.
ImageTopicAny ROS topic which is structured in image message.
ImageAny image file which can be parsed by openCV, such as .png, .jpeg.
VideoAny video file which can be parsed by openCV.
IpCameraAny RTSP server which can push video stream.
</details> </p>

Inference Implementations

Currently, the corresponding relation of supported inference features, models used and yaml configurations are listed as follows:

<p> <details> <summary>Inference Feature Correspondence Table</summary>
InferenceDescriptionYAML ConfigurationModel Used
Face DetectionObject Detection task applied to face recognition using a sequence of neural networks.pipeline_image.yaml<br>pipeline_image_video.yaml<br>pipeline_people.yaml<br>pipeline_people_ip.yamlface-detection-adas-0001<br>age-gender-recognition-retail-0013<br>emotions-recognition-retail-0003<br>head-pose-estimation-adas-0001
Emotion RecognitionEmotion recognition based on detected face image.pipeline_image.yaml<br>pipeline_image_video.yaml<br>pipeline_people.yaml<br>pipeline_people_ip.yamlemotions-recognition-retail-0003
Age & Gender RecognitionAge and gender recognition based on detected face image.pipeline_image.yaml<br>pipeline_image_video.yaml<br>pipeline_people.yaml<br>pipeline_people_ip.yamlage-gender-recognition-retail-0013
Head Pose EstimationHead pose estimation based on detected face image.pipeline_image.yaml<br>pipeline_image_video.yaml<br>pipeline_people.yaml<br>pipeline_people_ip.yamlhead-pose-estimation-adas-0001
Object DetectionObject detection based on SSD-based trained models.pipeline_object.yaml<br>pipeline_object_topic.yamlmobilenet-ssd
Vehicle and License DetectionVehicle and license detection based on Intel models.pipeline_vehicle_detection.yamlvehicle-license-plate-detection-barrier-0106<br>vehicle-attributes-recognition-barrier-0039<br>license-plate-recognition-barrier-0001
Object SegmentationObject segmentation.pipeline_segmentation.yaml<br>pipeline_segmentation_image.yaml<br>pipeline_video.yamlsemantic-segmentation-adas-0001<br>deeplabv3
Person AttributesPerson attributes based on object detection.pipeline_person_attributes.yamlperson-attributes-recognition-crossroad-0230<br>person-detection-retail-0013
Person ReidentificationPerson reidentification based on object detection.pipeline_person_reidentification.yamlperson-detection-retail-0013<br>person-reidentification-retail-0277
Object Segmentation MaskrcnnObject segmentation and detection based on maskrcnn model.pipeline_segmentation_maskrcnn.yamlmask_rcnn_inception_v2_coco_2018_01_28
</details> </p>

ROS interfaces and outputs

The inference results can be output in several types. One or more types can be enabled for any inference pipeline.

Topic

Specific topic(s) can be generated and published according to the given inference functionalities.

<p> <details> <summary>Published Topic Correspondence Table</summary>
InferencePublished Topic
People Detection/ros2_openvino_toolkit/face_detection(object_msgs:msg:ObjectsInBoxes)
Emotion Recognition/ros2_openvino_toolkit/emotions_recognition(object_msgs:msg:EmotionsStamped)
Age and Gender Recognition/ros2_openvino_toolkit/age_genders_Recognition(object_msgs:msg:AgeGenderStamped)
Head Pose Estimation/ros2_openvino_toolkit/headposes_estimation(object_msgs:msg:HeadPoseStamped)
Object Detection/ros2_openvino_toolkit/detected_objects(object_msgs::msg::ObjectsInBoxes)
Object Segmentation/ros2_openvino_toolkit/segmented_obejcts(object_msgs::msg::ObjectsInMasks)
Object Segmentation Maskrcnn/ros2_openvino_toolkit/segmented_obejcts(object_msgs::msg::ObjectsInMasks)
Person Reidentification/ros2_openvino_toolkit/reidentified_persons(object_msgs::msg::ReidentificationStamped)
Vehicle Detection/ros2_openvino_toolkit/detected_vehicles_attribs(object_msgs::msg::VehicleAttribsStamped)
Vehicle License Detection/ros2_openvino_toolkit/detected_license_plates(object_msgs::msg::LicensePlateStamped)
</details> </p>

Service

Several ROS2 Services are created, expecting to be used in client/server mode, especially when synchronously getting inference results for a given image frame or when managing inference pipeline's lifecycle.</br>

<p> <details> <summary>Service Correspondence Table</summary>
InferenceService
Object Detection Service/detect_object(object_msgs::srv::DetectObject)
Face Detection Service/detect_face(object_msgs::srv::DetectObject)
Age Gender Detection Service/detect_age_gender(object_msgs::srv::AgeGender)
Headpose Detection Service/detect_head_pose(object_msgs::srv::HeadPose)
Emotion Detection Service/detect_emotion(object_msgs::srv::Emotion)
</details> </p>

RViz

RViz display is also supported by the composited topic of original image frame with inference result. To show in RViz tool, add an image marker with the composited topic: /ros2_openvino_toolkit/image_rviz(sensor_msgs::Image)

Image Window

OpenCV based image window is natively supported by the package. To enable window, Image Window output should be added into the output choices in .yaml config file. Refer to the config file guidance for more information about checking/adding this feature in your launching.

Demo Result Snapshots

For the snapshot of demo results, refer to the following picture.

Installation and Launching

Deploy in Local Environment

Deploy in Docker

Reference

FAQ

Feedback

More Information

Any security issue should be reported using process at https://01.org/security