Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

ROS ov2.0 #195

Open
wants to merge 41 commits into
base: ros
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ffa78bf
fix engine api
ChloeWu1 Oct 10, 2022
ac2e596
fix pipeline api
ChloeWu1 Oct 11, 2022
9dfd32f
fix base_inference api
ChloeWu1 Oct 11, 2022
aed1c24
fix version info
ChloeWu1 Oct 11, 2022
04d7a0d
fix base model
ChloeWu1 Oct 11, 2022
4921a24
fix age gender detection pipeline
ChloeWu1 Oct 12, 2022
0b224e2
fix emotion detection pipeline
ChloeWu1 Oct 12, 2022
451dfcd
fix head pose detection pipeline
ChloeWu1 Oct 12, 2022
f005a2f
fix person reidentification pipeline
ChloeWu1 Oct 12, 2022
4273a40
fix object segmentation pipeline
ChloeWu1 Oct 12, 2022
6d5b7a0
fix object detection(ssd) pipeline
ChloeWu1 Oct 12, 2022
853f773
fix license plate detection pipeline
ChloeWu1 Oct 13, 2022
daae598
fix vehicle attribs detection pipeline
ChloeWu1 Oct 13, 2022
de67e59
fix person attribs detection pipeline
ChloeWu1 Oct 13, 2022
ef7c030
fix object detection(yolo) pipeline
ChloeWu1 Oct 13, 2022
0d3d74a
fix face reidentification pipeline
ChloeWu1 Oct 16, 2022
0060965
fix landmarks detection pipeline
ChloeWu1 Oct 16, 2022
b120aa0
fix pipeline manager
ChloeWu1 Oct 16, 2022
4eb2869
fix pipeline params API
ChloeWu1 Oct 17, 2022
439c569
fix CMakeLists
ChloeWu1 Oct 17, 2022
68a5aa4
clean code and fix head files
ChloeWu1 Oct 17, 2022
374b648
Add NCHW and NHWC layout compatibility for object_segmentation and ob…
ChloeWu1 Oct 18, 2022
ca444e6
clean code
ChloeWu1 Oct 18, 2022
dc8e996
update docs for ov2.0
ChloeWu1 Oct 19, 2022
b79a632
fix docs
ChloeWu1 Oct 20, 2022
c6f4fa3
fix param name
ChloeWu1 Nov 11, 2022
7adb00c
code refine: move input&output info definition to base attribute
ChloeWu1 Nov 11, 2022
5ad3792
update doc and model list for ros
ChloeWu1 Nov 21, 2022
474c8dd
add dockerfile and instruction for ros
ChloeWu1 Dec 8, 2022
a479937
refine dockerfile
ChloeWu1 Dec 12, 2022
fed6345
add segmentation maskrcnn pipeline
ChloeWu1 Dec 12, 2022
3c23d15
fix vehicle attribs and license plate
ChloeWu1 Dec 12, 2022
1158e5c
fix yaml path
ChloeWu1 Dec 12, 2022
cfea37d
fix doc dockerfile and model list
ChloeWu1 Dec 13, 2022
3d27120
fix param
ChloeWu1 Dec 13, 2022
809ebfb
fix model download list
ChloeWu1 Dec 15, 2022
3d97a61
fix label path
ChloeWu1 Dec 19, 2022
b7f6ee6
fix label path for docker
ChloeWu1 Dec 19, 2022
98fb7ce
update documents for ros 2.0
ChloeWu1 Dec 21, 2022
066ab65
Merge branch 'ros' into noetic-ov2022.1
ChloeWu1 Dec 23, 2022
fad9c8b
fix docker
ChloeWu1 Dec 27, 2022
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
5 changes: 5 additions & 0 deletions data/model_list/convert_model.lst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file can be used with the --list option of the model converter.
mobilenet-ssd
deeplabv3
mask_rcnn_inception_resnet_v2_atrous_coco
vehicle-license-plate-detection-barrier-0123
16 changes: 16 additions & 0 deletions data/model_list/download_model.lst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file can be used with the --list option of the model downloader.
face-detection-adas-0001
age-gender-recognition-retail-0013
emotions-recognition-retail-0003

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no found the xml: face-reidentification-retail-0095.xml
if it is need.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the xml vehicle-license-plate-detection-barrier-0123.xml

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

landmarks-regression-retail-0009
license-plate-recognition-barrier-0001
person-detection-retail-0013
person-attributes-recognition-crossroad-0230
person-reidentification-retail-0277
vehicle-attributes-recognition-barrier-0039
vehicle-license-plate-detection-barrier-0106
head-pose-estimation-adas-0001
human-pose-estimation-0001
semantic-segmentation-adas-0001
mobilenet-ssd
deeplabv3
194 changes: 194 additions & 0 deletions doc/quick_start/getting_started_with_Noetic_Ubuntu20.04_ov2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# ROS_NOETIC_OpenVINO_Toolkit

**NOTE:**
Below steps have been tested on **Ubuntu 20.04**.

## 1. Environment Setup
* Install ROS Noetic ([guide](http://wiki.ros.org/noetic/Installation/Ubuntu)).

* 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 ([guide](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/download.html)).
Tips: Both runtime and development tool are needed, `pip` is recommended for installing the development tool ([guide](https://docs.openvino.ai/latest/openvino_docs_install_guides_install_dev_tools.html)).
* Install from source code ([guide](https://github.com/openvinotoolkit/openvino/wiki/BuildingForLinux)).

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

* Install Dependency
* Install gflags
```
sudo apt-get install -y libgflags-dev
```

## 2. Build and Installation
* Install ROS_OpenVINO_Toolkit packages
```
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/intel/ros_openvino_toolkit -b noetic
git clone https://github.com/intel/object_msgs
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros
git checkout `git tag | sort -V | grep -P "^2.\d+\.\d+" | tail -1`
```
* Install dependencies
```
sudo apt-get install ros-noetic-ddynamic-reconfigure
```
* Build package
```
source /opt/ros/noetic/setup.bash
source <OpenVINO_INSTALL_DIR>/setupvars.sh
cd ~/catkin_ws
catkin_make_isolated
source ./devel_isolated/setup.bash
```

## 3. Running the Demo
### Install OpenVINO 2022.1 by source code
* See all available models
```
cd <OpenVINO_SOURCECODE_DIR>/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 downloader.py --print_all
```

* Download the optimized Intermediate Representation (IR) of model (execute once):
```
cd <OpenVINO_SOURCECODE_DIR>/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 downloader.py --name face-detection-adas-0001 --output_dir /opt/openvino_toolkit/models/face_detection/output
sudo python3 downloader.py --name age-gender-recognition-retail-0013 --output_dir /opt/openvino_toolkit/models/age-gender-recognition/output
sudo python3 downloader.py --name emotions-recognition-retail-0003 --output_dir /opt/openvino_toolkit/models/emotions-recognition/output
sudo python3 downloader.py --name head-pose-estimation-adas-0001 --output_dir /opt/openvino_toolkit/models/head-pose-estimation/output
sudo python3 downloader.py --name person-detection-retail-0013 --output_dir /opt/openvino_toolkit/models/person-detection/output
sudo python3 downloader.py --name person-reidentification-retail-0277 --output_dir /opt/openvino_toolkit/models/person-reidentification/output
sudo python3 downloader.py --name landmarks-regression-retail-0009 --output_dir /opt/openvino_toolkit/models/landmarks-regression/output
sudo python3 downloader.py --name face-reidentification-retail-0095 --output_dir /opt/openvino_toolkit/models/face-reidentification-retail/output
sudo python3 downloader.py --name vehicle-attributes-recognition-barrier-0039 --output_dir /opt/openvino_toolkit/models/vehicle-attributes-recognition/output
sudo python3 downloader.py --name license-plate-recognition-barrier-0001 --output_dir /opt/openvino_toolkit/models/license-plate-recognition/output
```

* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection)
* mobilenet-ssd (replaced ssd_mobilenet_v2_coco to mobilenet-ssd for object detection in ov2022)
```
cd <OpenVINO_SOURCECODE_DIR>/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 downloader.py --name mobilenet-ssd --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/output
sudo python3 converter.py --name mobilenet-ssd -d /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/output/ -o /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/output/convert
```
* vehicle-license-plate-detection-barrier-0123
```
cd <OpenVINO_SOURCECODE_DIR>/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 downloader.py --name vehicle-license-plate-detection-barrier-0123 --output_dir /opt/openvino_toolkit/models/vehicle-license-plate-detection-barrier/output
sudo python3 converter.py --name vehicle-license-plate-detection-barrier-0123 -d /opt/openvino_toolkit/models/vehicle-license-plate-detection-barrier/output -o /opt/openvino_toolkit/models/vehicle-license-plate-detection-barrier/output/convert
```
* deeplabv3
```
cd <OpenVINO_SOURCECODE_DIR>/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 downloader.py --name deeplabv3 --output_dir /opt/openvino_toolkit/models/deeplabv3/output
sudo python3 converter.py --name deeplabv3 -d /opt/openvino_toolkit/models/deeplabv3/output -o /opt/openvino_toolkit/models/deeplabv3/output/convert
```

* Copy label files (execute once)
* Before launch, copy label files to the same model path, make sure the model path and label path match the ros_openvino_toolkit/vino_launch/param/xxxx.yaml.
```
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels /opt/openvino_toolkit/models/emotions-recognition/output/intel/emotions-recognition-retail-0003/FP32/
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels /opt/openvino_toolkit/models/emotions-recognition/output/intel/emotions-recognition-retail-0003/FP16/
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/face_detection/output/intel/face-detection-adas-0001/FP32/
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/face_detection/output/intel/face-detection-adas-0001/FP16/
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/object_detection/vehicle-license-plate-detection-barrier-0106.labels /opt/openvino_toolkit/models/vehicle-license-plate-detection/output/convert/intel/vehicle-license-plate-detection-barrier-0106/FP32

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is used FP16/vehicle-license-plate-detection-barrier-0106.labels at the pipeline_vehicle_detection.yaml. but there are FP32

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/object_detection/mobilenet-ssd.labels /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/output/convert/public/mobilenet-ssd/FP16
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/deeplabv3/output/convert/public/deeplabv3/FP16
sudo mv /opt/openvino_toolkit/models/deeplabv3/output/convert/public/deeplabv3/FP16/frozen_inference_graph.labels /opt/openvino_toolkit/models/deeplabv3/output/convert/public/deeplabv3/FP16/deeplabv3.labels
```
### Install OpenVINO 2022.1 by PIP
* OMZ tools are provided for downloading and converting OMZ models 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:
```
omz_downloader --name face-detection-adas-0001 --output_dir /opt/openvino_toolkit/models/face_detection/output
omz_downloader --name age-gender-recognition-retail-0013 --output_dir /opt/openvino_toolkit/models/age-gender-recognition/output
omz_downloader --name emotions-recognition-retail-0003 --output_dir /opt/openvino_toolkit/models/emotions-recognition/output
omz_downloader --name head-pose-estimation-adas-0001 --output_dir /opt/openvino_toolkit/models/head-pose-estimation/output
omz_downloader --name person-detection-retail-0013 --output_dir /opt/openvino_toolkit/models/person-detection/output
omz_downloader --name person-reidentification-retail-0277 --output_dir /opt/openvino_toolkit/models/person-reidentification/output
omz_downloader --name landmarks-regression-retail-0009 --output_dir /opt/openvino_toolkit/models/landmarks-regression/output
omz_downloader --name semantic-segmentation-adas-0001 --output_dir /opt/openvino_toolkit/models/semantic-segmentation/output
omz_downloader --name vehicle-attributes-recognition-barrier-0039 --output_dir /opt/openvino_toolkit/models/vehicle-attributes-recognition/output
omz_downloader --name license-plate-recognition-barrier-0001 --output_dir /opt/openvino_toolkit/models/license-plate-recognition/output
```
* Copy label files (execute once)
```
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels /opt/openvino_toolkit/models/emotions-recognition/output/intel/emotions-recognition-retail-0003/FP32/
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels /opt/openvino_toolkit/models/emotions-recognition/output/intel/emotions-recognition-retail-0003/FP16/
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/face_detection/output/intel/face-detection-adas-0001/FP32/
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/face_detection/output/intel/face-detection-adas-0001/FP16/
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/object_detection/vehicle-license-plate-detection-barrier-0106.labels /opt/openvino_toolkit/models/vehicle-license-plate-detection/output/convert/intel/vehicle-license-plate-detection-barrier-0106/FP32
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/object_detection/mobilenet-ssd.labels /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/output/convert/public/mobilenet-ssd/FP16
sudo cp ~/catkin_ws/src/ros_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/deeplabv3/output/convert/public/deeplabv3/FP16
sudo mv /opt/openvino_toolkit/models/deeplabv3/output/convert/public/deeplabv3/FP16/frozen_inference_graph.labels /opt/openvino_toolkit/models/deeplabv3/output/convert/public/deeplabv3/FP16/deeplabv3.labels
```

* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi) need to be converted to intermediate representation (such as the model for object detection):
* mobilenet-ssd (replaced ssd_mobilenet_v2_coco to mobilenet-ssd for object detection in ov2022)
```
omz_downloader --name mobilenet-ssd --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/output
omz_converter --name mobilenet-ssd -d /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/output -o /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/output/convert
```
* vehicle-license-plate-detection-barrier-0123
```
omz_downloader --name vehicle-license-plate-detection-barrier-0123 --output_dir /opt/openvino_toolkit/models/vehicle-license-plate-detection-barrier/output
omz_converter --name vehicle-license-plate-detection-barrier-0123 -d /opt/openvino_toolkit/models/vehicle-license-plate-detection-barrier/output -o /opt/openvino_toolkit/models/vehicle-license-plate-detection-barrier/output/convert
```

* deeplabv3
```
omz_downloader --name deeplabv3 --output_dir /opt/openvino_toolkit/models/deeplabv3/output
omz_converter --name deeplabv3 -d /opt/openvino_toolkit/models/deeplabv3/output -o /opt/openvino_toolkit/models/deeplabv3/output/convert
```

* Please check the parameter configuration in ros_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.
```
roslaunch vino_launch pipeline_people.launch
```
* run person reidentification sample code input from StandardCamera.
```
roslaunch vino_launch pipeline_face_reidentification.launch
```
* run person reidentification sample code input from StandardCamera
```
roslaunch vino_launch pipeline_reidentification.launch
```
* run face detection sample code input from Image.
```
roslaunch vino_launch pipeline_image.launch
```
* run object sample
```
roslaunch vino_launch pipeline_object.launch
```
* run object topic sample
```
roslaunch vino_launch pipeline_object_topic.launch
```
* run object segmentation sample code input from RealSenseCamera.
```
roslaunch vino_launch pipeline_segmentation.launch
```
* run vehicle detection sample code input from StandardCamera.
```
roslaunch vino_launch pipeline_vehicle_detection.launch
```
* run video sample
```
roslaunch vino_launch pipeline_video.launch
```

# More Information

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


Loading