Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 0 additions & 181 deletions doc/quick_start/getting_started_with_Galactic_Ubuntu20.04_ov2.0.md

This file was deleted.

132 changes: 132 additions & 0 deletions doc/quick_start/getting_started_with_ros2_ov2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# ROS2_OpenVINO_Toolkit

**NOTE:**
Below steps have been tested on **Ubuntu 20.04** and **Ubuntu 22.04**.
Supported ROS2 versions include foxy,galactic and humble.

## 1. Environment Setup
* For ROS2 foxy and galactic on ubuntu 20.04:
* Install ROS2. ([foxy_guide](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html)) & ([galactic_guide](https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html))

* Install Intel® OpenVINO™ Toolkit Version: 2022.1. ([guide](https://docs.openvino.ai/2022.1/openvino_docs_install_guides_installing_openvino_linux.html))
* Install from an achive file. Both runtime and development tool are needed, `pip` is recommended for installing the development tool. ([guide](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/download.html))

* Install Intel® RealSense™ SDK. ([guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md))

* For ROS2 humble on ubuntu 22.04:
* Install ROS2. ([humble_guide](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html))

* Install Intel® OpenVINO™ Toolkit Latest Version by Source. ([guide](https://github.com/openvinotoolkit/openvino/wiki/BuildingCode))

* Install Intel® RealSense™ SDK by Source. ([guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md))

## 2. Building and Installation
* Install ROS2_OpenVINO_Toolkit packages
```
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/intel/ros2_openvino_toolkit -b ros2
git clone https://github.com/intel/ros2_object_msgs
git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2-development
git clone https://github.com/ros-perception/vision_opencv.git -b <ROS2_VERSION>
```
* Install dependencies
```
sudo apt-get install ros-<ROS2_VERSION>-diagnostic-updater
sudo apt install python3-colcon-common-extensions
```
* Build package
```
source /opt/ros/<ROS2_VERSION>/setup.bash
source <OpenVINO_INSTALL_DIR>/setupvars.sh
cd ~/catkin_ws
colcon build --symlink-install
source ./install/local_setup.bash
```

## 3. Running the Demo
### Install OpenVINO 2022.1 by PIP
* OMZ tools are provided for downloading and converting models of open_model_zoo in ov2022.([guide](https://pypi.org/project/openvino-dev/))

* See all available models
```
omz_downloader --print_all
```

* Download the optimized Intermediate Representation (IR) of model (execute once), for example:
```
cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list
omz_downloader --list download_model.lst -o /opt/openvino_toolkit/models/
```

* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi) need to be converted to intermediate representation (such as the model for object detection):
```
cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list
omz_converter --list convert_model.lst -o /opt/openvino_toolkit/models/convert
```
### Install OpenVINO 2022.1 by source code
* See all available models
```
cd ~/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 downloader.py --print_all
```

* Download the optimized Intermediate Representation (IR) of models (execute once), for example:
```
cd ~/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 downloader.py --list download_model.lst -o /opt/openvino_toolkit/models/
```

* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi) need to be converted to Intermediate Representation (such as the model for object detection):
```
cd ~/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 converter.py --list convert_model.lst -o /opt/openvino_toolkit/models/convert
```

* Copy label files (execute once)
**Note**:Need to make label_dirs if skip steps for set output_dirs above.
```
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP32/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/intel/semantic-segmentation-adas-0001/FP32/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/intel/semantic-segmentation-adas-0001/FP16/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_detection/vehicle-license-plate-detection-barrier-0106.labels /opt/openvino_toolkit/models/intel/vehicle-license-plate-detection-barrier-0106/FP32
```

* Please check the parameter configuration in ros2_openvino_toolkit/sample/param/xxxx.yaml before lauching, make sure parameters such as model_path, label_path and input_path are set correctly.

* run face detection sample code input from StandardCamera.
```
ros2 launch dynamic_vino_sample pipeline_people.launch.py
```
* run person reidentification sample code input from StandardCamera.
```
ros2 launch dynamic_vino_sample pipeline_reidentification.launch.py
```
* run person face reidentification sample code input from RealSenseCamera.
```
ros2 launch dynamic_vino_sample pipeline_face_reidentification.launch.py
```
* run face detection sample code input from Image.
```
ros2 launch dynamic_vino_sample pipeline_image.launch.py
```
* run object segmentation sample code input from RealSenseCameraTopic.
```
ros2 launch dynamic_vino_sample pipeline_segmentation.launch.py
```
* run vehicle detection sample code input from StandardCamera.
```
ros2 launch dynamic_vino_sample pipeline_vehicle_detection.launch.py
```
* run person attributes sample code input from StandardCamera.
```
ros2 launch dynamic_vino_sample pipeline_person_attributes.launch.py
```

# More Information
* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw

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

5 changes: 3 additions & 2 deletions sample/param/image_object_server.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Pipelines:
- name: object
inputs: [Image]
input_path: to/be/set/image_path
infers:
- name: ObjectDetection
model: /opt/openvino_toolkit/models/object_detection/mobilenet-ssd/caffe/output/FP32/mobilenet-ssd.xml
model: /opt/openvino_toolkit/models/convert/public/mobilenet-ssd/FP16/mobilenet-ssd.xml
engine: CPU
label: to/be/set/xxx.labels
batch: 1
Expand All @@ -15,6 +16,6 @@ Pipelines:
right: [ObjectDetection]
- left: ObjectDetection
right: [RosService]
input_path: "/home/intel/Pictures/car.png"


Common:
Loading