Skip to content

Commit b91e18a

Browse files
committed
fix merging conflicts.
Signed-off-by: Liu, Wei Zhi <[email protected]>
1 parent 622e0b4 commit b91e18a

25 files changed

+198
-213
lines changed

.ci_local_test/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

3-
The Jenkinsfile Introduce:
3+
Jenkins file Introduction:
44

5-
1. The jenkins matchine would scan the ROS2_Openvion project regularly.
5+
1. The Jenkins machine would scan the ROS2_OpenVINO project regularly.
66

77
it would trigger test when scan the PR or other change.
88

Original file line numberDiff line numberDiff line change
@@ -1,43 +1,33 @@
11
#!/bin/bash
22

33
export DISPLAY=:0
4-
54
export work_dir=$PWD
65

7-
8-
function run_container() {
9-
10-
docker images | grep ros2_openvino_docker
11-
12-
if [ $? -eq 0 ]
13-
then
14-
echo "the image of ros2_openvino_docker:01 existence"
6+
function run_container()
7+
{
8+
if docker images -q ros2_openvino_docker:01 &>/dev/null; then
9+
echo "The container ros2_openvino_docker:01 image exists"
1510
docker rmi -f ros2_openvino_docker:01
1611
fi
1712

1813
docker ps -a | grep ros2_openvino_container
19-
if [ $? -eq 0 ]
20-
then
14+
if docker ps -aq -f name=ros2_openvino_container; then
15+
echo "The container ros2_openvino_container exists. Removing the container..."
2116
docker rm -f ros2_openvino_container
2217
fi
2318

2419
# Removing some docker image ..
2520
# Using jenkins server ros2_openvino_toolkit code instead of git clone code.
26-
cd $work_dir && sed -i '/RUN git clone -b ros2/d' Dockerfile
21+
cd "$work_dir" && sed -i '/RUN git clone -b ros2/d' Dockerfile
2722
# add the jpg for test.
28-
cd $work_dir && sed -i '$i COPY jpg /root/jpg' Dockerfile
29-
30-
cd $work_dir && docker build --build-arg ROS_PRE_INSTALLED_PKG=galactic-desktop --build-arg VERSION=galactic -t ros2_openvino_docker:01 .
31-
cd $work_dir && docker images
32-
docker run -i --privileged=true --device=/dev/dri -v $work_dir/ros2_openvino_toolkit:/root/catkin_ws/src/ros2_openvino_toolkit -v $HOME/.Xauthority:/root/.Xauthority -e GDK_SCALE -v $work_dir/test_cases:/root/test_cases --name ros2_openvino_container ros2_openvino_docker:01 bash -c "cd /root/test_cases && ./run.sh galactic"
23+
cd "$work_dir" && sed -i '$i COPY jpg /root/jpg' Dockerfile
3324

25+
cd "$work_dir" && docker build --build-arg ROS_PRE_INSTALLED_PKG=galactic-desktop --build-arg VERSION=galactic -t ros2_openvino_docker:01 .
26+
cd "$work_dir" && docker images
27+
docker run -i --privileged=true --device=/dev/dri -v "$work_dir"/ros2_openvino_toolkit:/root/catkin_ws/src/ros2_openvino_toolkit -v "$HOME"/.Xauthority:/root/.Xauthority -e GDK_SCALE -v "$work_dir"/test_cases:/root/test_cases --name ros2_openvino_container ros2_openvino_docker:01 bash -c "cd /root/test_cases && ./run.sh galactic"
3428
}
3529

36-
run_container
37-
if [ $? -ne 0 ]
38-
then
39-
echo "Test fail"
40-
exit -1
30+
if ! run_container; then
31+
echo "Test failed"
32+
exit 1
4133
fi
42-
43-

.ci_local_test/ros2_openvino_toolkit_test/test_cases/ros2_openvino_tool_model_download.sh

+4-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
mkdir -p /opt/openvino_toolkit/models
44
#apt install -y python-pip
55
apt install -y python3.8-venv
6-
cd ~ && python3 -m venv openvino_env && source openvino_env/bin/activate
6+
cd ~ && python3 -m venv openvino_env
7+
#shellcheck source=/dev/null
8+
source openvino_env/bin/activate
79
python -m pip install --upgrade pip
8-
pip install openvino-dev[tensorflow2,onnx]==2022.3
9-
10+
pip install "openvino-dev[tensorflow2,onnx]==2022.3"
1011

1112
#Download the optimized Intermediate Representation (IR) of model (execute once)
1213
cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list && omz_downloader --list download_model.lst -o /opt/openvino_toolkit/models/
13-
1414
cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list && omz_converter --list convert_model.lst -d /opt/openvino_toolkit/models/ -o /opt/openvino_toolkit/models/convert
1515

16-
1716
#Copy label files (execute once)
1817
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/
1918
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/
@@ -27,4 +26,3 @@ cp /opt/openvino_toolkit/models/convert/public/mask_rcnn_inception_resnet_v2_atr
2726

2827
cd /root/test_cases/ && ./yolov5_model_download.sh
2928
cd /root/test_cases/ && ./yolov8_model_download.sh
30-

.ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ then
77
else
88
export ros2_branch=$1
99
fi
10-
source /root/test_cases/config.sh $ros2_branch
10+
#shellcheck source=/dev/null
11+
source /root/test_cases/config.sh "$ros2_branch"
1112

1213
cd /root/catkin_ws && colcon build --symlink-install
13-
cd /root/catkin_ws && source ./install/local_setup.bash
14+
# shellcheck source=/dev/null
15+
source ./install/local_setup.bash
1416

1517
apt-get update
1618
# apt-get install -y ros-$ros2_branch-diagnostic-updater
@@ -31,6 +33,5 @@ result=$?
3133
echo "Test ENV:" && df -h && free -g
3234
if [ $result -ne 0 ]
3335
then
34-
exit -1
36+
exit 1
3537
fi
36-

.ci_local_test/ros2_openvino_toolkit_test/test_cases/yolov5_model_download.sh

+9-11
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,32 @@ cd /root && git clone https://github.com/ultralytics/yolov5.git
55

66
#Set Environment for Installing YOLOv5
77

8-
cd yolov5
8+
cd yolov5 || exit
99
python3 -m venv yolo_env # Create a virtual python environment
10+
# shellcheck source=/dev/null
1011
source yolo_env/bin/activate # Activate environment
1112
pip install -r requirements.txt # Install yolov5 prerequisites
1213
pip install wheel
1314
pip install onnx
1415

1516
# Download PyTorch Weights
16-
mkdir -p /root/yolov5/model_convert && cd /root/yolov5/model_convert
17+
mkdir -p /root/yolov5/model_convert && cd /root/yolov5/model_convert || exit
1718
wget https://github.com/ultralytics/yolov5/releases/download/v6.2/yolov5n.pt
1819

19-
cd /root/yolov5
20+
cd /root/yolov5 || exit
2021
python3 export.py --weights model_convert/yolov5n.pt --include onnx
2122

22-
2323
#2. Convert ONNX files to IR files
24-
cd /root/yolov5/
24+
cd /root/yolov5/ || exit
2525
python3 -m venv ov_env # Create openVINO virtual environment
26+
# shellcheck source=/dev/null
2627
source ov_env/bin/activate # Activate environment
2728
python -m pip install --upgrade pip # Upgrade pip
28-
pip install openvino[onnx]==2022.3.0 # Install OpenVINO for ONNX
29-
pip install openvino-dev[onnx]==2022.3.0 # Install OpenVINO Dev Tool for ONNX
30-
29+
pip install "openvino[onnx]==2022.3.0" # Install OpenVINO for ONNX
30+
pip install "openvino-dev[onnx]==2022.3.0" # Install OpenVINO Dev Tool for ONNX
3131

32-
cd /root/yolov5/model_convert
32+
cd /root/yolov5/model_convert || exit
3333
mo --input_model yolov5n.onnx
3434

35-
3635
mkdir -p /opt/openvino_toolkit/models/convert/public/yolov5n/FP32/
3736
sudo cp yolov5n.bin yolov5n.mapping yolov5n.xml /opt/openvino_toolkit/models/convert/public/yolov5n/FP32/
38-

.ci_local_test/ros2_openvino_toolkit_test/test_cases/yolov8_model_download.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22

33
#Pip install the ultralytics package including all requirements in a Python>=3.7 environment with PyTorch>=1.7.
44

5-
mkdir -p yolov8 && cd yolov8
5+
mkdir -p yolov8 && cd yolov8 || exit
66
pip install ultralytics
77
apt install python3.8-venv
88
python3 -m venv openvino_env
9+
# shellcheck source=/dev/null
910
source openvino_env/bin/activate
1011

11-
1212
#Export a YOLOv8n model to a different format like ONNX, CoreML, etc.
1313
# export official model
1414
yolo export model=yolov8n.pt format=openvino
1515
yolo export model=yolov8n-seg.pt format=openvino
1616

17-
1817
# Move to the Recommended Model Path
1918
mkdir -p /opt/openvino_toolkit/models/convert/public/FP32/yolov8n
2019
mkdir -p /opt/openvino_toolkit/models/convert/public/FP32/yolov8n-seg
2120

2221
cp yolov8n_openvino_model/* /opt/openvino_toolkit/models/convert/public/FP32/yolov8n
2322
cp yolov8n-seg_openvino_model/* /opt/openvino_toolkit/models/convert/public/FP32/yolov8n-seg
24-

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Overview
2525
## ROS2 Version Supported
2626

27-
|Branch Name|ROS2 Version Supported|Openvino Version|OS Version|
27+
|Branch Name|ROS2 Version Supported|OpenVINO Version|OS Version|
2828
|-----------------------|-----------------------|--------------------------------|----------------------|
2929
|[ros2](https://github.com/intel/ros2_openvino_toolkit/tree/ros2)|Galactic, Foxy, Humble|V2022.1, V2022.2, V2022.3|Ubuntu 20.04, Ubuntu 22.04|
3030
|[dashing](https://github.com/intel/ros2_openvino_toolkit/tree/dashing)|Dashing|V2022.1, V2022.2, V2022.3|Ubuntu 18.04|
@@ -50,12 +50,12 @@
5050
|**OS**|Mandatory|We 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.**|
5151
|**ROS2**|Mandatory|We 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**](#ros2-version-supported).|
5252
|**OpenVINO**|Mandatory|The version of OpenVINO toolkit is decided by the OS and ROS2 distros you use. See the table above in Section [**ROS2 Version Supported**](#ros2-version-supported).|
53-
|**Realsense Camera**|Optional|Realsense Camera is optional, you may choose these alternatives as the input: Standard Camera, ROS Image Topic, Video/Image File or RTSP camera.|
53+
|**RealSense Camera**|Optional|RealSense Camera is optional, you may choose these alternatives as the input: Standard Camera, ROS Image Topic, Video/Image File or RTSP camera.|
5454

5555
# Introduction
5656
## Design Architecture
5757
<p><details><summary>Architecture Design</summary>
58-
From the view of hirarchical architecture design, the package is divided into different functional components, as shown in below picture.
58+
From the view of hierarchical architecture design, the package is divided into different functional components, as shown in below picture.
5959

6060
![OpenVINO_Architecture](./data/images/design_arch.PNG "OpenVINO RunTime Architecture")
6161

@@ -83,16 +83,16 @@ See more from [here](https://github.com/openvinotoolkit/openvino) for Intel Open
8383
<details>
8484
<summary>ROS Input & Output</summary>
8585

86-
- **Diversal Input resources** are data resources to be infered and analyzed with the OpenVINO framework.
87-
- **ROS interfaces and outputs** currently include _Topic_ and _service_. Natively, RViz output and CV image window output are also supported by refactoring topic message and inferrence results.
86+
- **Diverse Input resources** are data resources to be inferred and analyzed with the OpenVINO framework.
87+
- **ROS interfaces and outputs** currently include _Topic_ and _service_. Natively, RViz output and CV image window output are also supported by refactoring topic message and inference results.
8888
</details>
8989
</p>
9090

9191
<p>
9292
<details>
9393
<summary>Optimized Models</summary>
9494

95-
- **Optimized Models** provided by Model Optimizer component of Intel® OpenVINO™ toolkit. Imports trained models from various frameworks (Caffe*, Tensorflow*, MxNet*, ONNX*, Kaldi*) and converts them to a unified intermediate representation file. It also optimizes topologies through node merging, horizontal fusion, eliminating batch normalization, and quantization. It also supports graph freeze and graph summarize along with dynamic input freezing.
95+
- **Optimized Models** provided by Model Optimizer component of Intel® OpenVINO™ toolkit. Imports trained models from various frameworks (Caffe*, TensorFlow*, MxNet*, ONNX*, Kaldi*) and converts them to a unified intermediate representation file. It also optimizes topologies through node merging, horizontal fusion, eliminating batch normalization, and quantization. It also supports graph freeze and graph summarize along with dynamic input freezing.
9696
</details>
9797
</p>
9898
</details></p>
@@ -103,15 +103,15 @@ From the view of logic implementation, the package introduces the definitions of
103103

104104
![Logic_Flow](./data/images/impletation_logic.PNG "OpenVINO RunTime Logic Flow")
105105

106-
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.
106+
Once a corresponding program is launched with a specified .yaml config file passed in the .launch file or via command line, _**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.
107107

108108
The contents in **.yaml config file** should be well structured and follow the supported rules and entity names. Please see [yaml configuration guidance](./doc/quick_start/yaml_configuration_guide.md) for how to create or edit the config files.
109109

110110
<p>
111111
<details>
112112
<summary>Pipeline</summary>
113113

114-
**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.
114+
**Pipeline** fulfills the whole data handling process: initializing Input Component for image data gathering and formatting; building up the structured inference network and passing the formatted data through the inference network; transfering the inference results and handling output, etc.
115115
</details>
116116
</p>
117117

@@ -235,7 +235,7 @@ For the snapshot of demo results, refer to the following picture.
235235

236236
# Installation and Launching
237237
## Deploy in Local Environment
238-
* Refer to the quick start document for [getting_started_with_ros2](./doc/quick_start/getting_started_with_ros2_ov2.0.md) for detailed installation & lauching instructions.
238+
* Refer to the quick start document for [getting_started_with_ros2](./doc/quick_start/getting_started_with_ros2_ov2.0.md) for detailed installation & launching instructions.
239239
* Refer to the quick start document for [yaml configuration guidance](./doc/quick_start/yaml_configuration_guide.md) for detailed configuration guidance.
240240

241241
## Deploy in Docker
@@ -274,7 +274,7 @@ For the snapshot of demo results, refer to the following picture.
274274
* Report questions, issues and suggestions, using: [issue](https://github.com/intel/ros2_openvino_toolkit/issues).
275275
276276
# More Information
277-
* ROS2 OpenVINO discription written in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw
277+
* ROS2 OpenVINO description written in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw
278278
279279
###### *Any security issue should be reported using process at https://01.org/security*
280280
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
neutual
1+
neutral
22
happy
33
sad
4-
supprise
4+
surprise
55
anger

doc/quick_start/getting_started_with_Dashing_Ubuntu18.04.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/fr
7474
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_detection/vehicle-license-plate-detection-barrier-0106.labels /opt/openvino_toolkit/models/vehicle-license-plate-detection/output/intel/vehicle-license-plate-detection-barrier-0106/FP32
7575
```
7676

77-
* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection)
77+
* If the model (TensorFlow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection)
7878
* ssd_mobilenet_v2_coco
7979
```
8080
cd /opt/openvino_toolkit/models/
@@ -94,7 +94,7 @@ sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_detection/vehic
9494
sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=yolo-v2-tf --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py
9595
```
9696

97-
* Before launch, check the parameter configuration in ros2_openvino_toolkit/sample/param/xxxx.yaml, make sure the paramter like model path, label path, inputs are right.
97+
* Before launch, check the parameter configuration in ros2_openvino_toolkit/sample/param/xxxx.yaml, make sure the parameter like model path, label path, inputs are right.
9898
* run face detection sample code input from StandardCamera.
9999
```
100100
ros2 launch dynamic_vino_sample pipeline_people.launch.py
@@ -129,7 +129,7 @@ sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_detection/vehic
129129
```
130130

131131
# More Information
132-
* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw
132+
* ROS2 OpenVINO description written in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw
133133

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

doc/quick_start/getting_started_with_ros2_ov2.0.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ For ROS2 foxy and galactic on ubuntu 20.04:
1111

1212
* Install Intel® OpenVINO™ Toolkit Version: 2022.3.</br>
1313
Refer to: [OpenVINO_install_guide](https://docs.openvino.ai/2022.3/openvino_docs_install_guides_installing_openvino_apt.html#doxid-openvino-docs-install-guides-installing-openvino-apt)
14-
* Install from an achive file. Both runtime and development tool are needed, `pip` is recommended for installing the development tool.</br>
14+
* Install from an archive file. Both runtime and development tool are needed, `pip` is recommended for installing the development tool.</br>
1515
Refer to: [OpenVINO_devtool_install_guide](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/download.html)
1616

1717
* Install Intel® RealSense™ SDK.</br>
@@ -54,7 +54,7 @@ source ./install/local_setup.bash
5454
## 3. Running the Demo
5555
### Install OpenVINO 2022.3 by PIP
5656
OMZ tools are provided for downloading and converting models of open_model_zoo in ov2022.</br>
57-
Refer to: [OMZtool_guide](https://pypi.org/project/openvino-dev/)
57+
Refer to: [OMZ-tool_guide](https://pypi.org/project/openvino-dev/)
5858

5959
* See all available models
6060
```
@@ -67,7 +67,7 @@ cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list
6767
omz_downloader --list download_model.lst -o /opt/openvino_toolkit/models/
6868
```
6969

70-
* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi) need to be converted to intermediate representation (such as the model for object detection):
70+
* If the model (TensorFlow, caffe, MXNet, ONNX, Kaldi) need to be converted to intermediate representation (such as the model for object detection):
7171
```
7272
cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list
7373
omz_converter --list convert_model.lst -d /opt/openvino_toolkit/models/ -o /opt/openvino_toolkit/models/convert
@@ -85,7 +85,7 @@ cd ~/openvino/thirdparty/open_model_zoo/tools/model_tools
8585
sudo python3 downloader.py --list download_model.lst -o /opt/openvino_toolkit/models/
8686
```
8787

88-
* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi) need to be converted to Intermediate Representation (such as the model for object detection):
88+
* If the model (TensorFlow, caffe, MXNet, ONNX, Kaldi) need to be converted to Intermediate Representation (such as the model for object detection):
8989
```
9090
cd ~/openvino/thirdparty/open_model_zoo/tools/model_tools
9191
sudo python3 converter.py --list convert_model.lst -d /opt/openvino_toolkit/models/ -o /opt/openvino_toolkit/models/convert
@@ -102,7 +102,7 @@ sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/fr
102102
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
103103
```
104104

105-
* 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. Please refer to the quick start document for [yaml configuration guidance](./yaml_configuration_guide.md) for detailed configuration guidance.
105+
* Check the parameter configuration in ros2_openvino_toolkit/sample/param/xxxx.yaml before launching, make sure parameters such as model_path, label_path and input_path are set correctly. Please refer to the quick start document for [yaml configuration guide](./yaml_configuration_guide.md) for detailed configuration guidance.
106106
* run face detection sample code input from StandardCamera.
107107
```
108108
ros2 launch openvino_node pipeline_people.launch.py
@@ -129,7 +129,7 @@ sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_detection/vehic
129129
```
130130

131131
# More Information
132-
* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw
132+
* ROS2 OpenVINO description written in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw
133133

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

0 commit comments

Comments
 (0)