diff --git a/doc/quick_start/getting_started_with_Dashing_Ubuntu18.04.md b/doc/quick_start/getting_started_with_Dashing_Ubuntu18.04.md new file mode 100644 index 00000000..a4f7c3d0 --- /dev/null +++ b/doc/quick_start/getting_started_with_Dashing_Ubuntu18.04.md @@ -0,0 +1,138 @@ +# ROS2_OpenVINO_Toolkit + +**NOTE:** +Below steps have been tested on **Ubuntu 18.04**. + +## 1. Environment Setup +* Install ROS2 Dashing [(guide)](https://docs.ros.org/en/dashing/Installation/Ubuntu-Install-Debians.html) +* Install OpenVINO™ Toolkit Version: 2021.4 [(guide)](https://docs.openvino.ai/2021.4/openvino_docs_install_guides_installing_openvino_linux.html) +* Install Intel® RealSense™ SDK (https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md). + +## 2. Building and Installation +* Install ROS2_OpenVINO packages +``` +mkdir -p ~/catkin_ws/src +cd ~/catkin_ws/src +git clone https://github.com/intel/ros2_openvino_toolkit -b dashing +git clone https://github.com/intel/ros2_object_msgs +git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2 +git clone https://github.com/ros-perception/vision_opencv -b ros2 +``` +* Install dependencies +``` +sudo apt-get install ros-dashing-diagnostic-updater +``` +* Build package +``` +source /opt/ros/dashing/setup.bash +source /opt/intel/openvino_2021/bin/setupvars.sh +cd ~/catkin_ws +colcon build --symlink-install +source ./install/local_setup.bash +``` + +## 3. Running the Demo +* Preparation +``` +source /opt/intel/openvino_2021/bin/setupvars.sh +sudo mkdir -p /opt/openvino_toolkit +sudo ln -s /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader /opt/openvino_toolkit/models +sudo chmod 777 -R /opt/openvino_toolkit/models +``` + +* See all available models +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +sudo python3 downloader.py --print_all +``` + +* Download the optimized Intermediate Representation (IR) of model (execute once) +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +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 semantic-segmentation-adas-0001 --output_dir /opt/openvino_toolkit/models/semantic-segmentation/output +sudo python3 downloader.py --name vehicle-license-plate-detection-barrier-0106 --output_dir /opt/openvino_toolkit/models/vehicle-license-plate-detection/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 +sudo python3 downloader.py --name person-attributes-recognition-crossroad-0230 --output_dir /opt/openvino_toolkit/models/person-attributes/output +``` + +* 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/ros2_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/ros2_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/ros2_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/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/ +sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/ +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 +``` + +* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection) +* ssd_mobilenet_v2_coco + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name ssd_mobilenet_v2_coco + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=ssd_mobilenet_v2_coco --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * deeplabv3 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name deeplabv3 + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=deeplabv3 --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * YOLOV2 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name yolo-v2-tf + 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 + ``` + +* 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. + * 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 RealSenseCamera. + ``` + ros2 launch dynamic_vino_sample pipeline_segmentation.launch.py + ``` + * run object segmentation sample code input from Image. + ``` + ros2 launch dynamic_vino_sample pipeline_segmentation_image.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* + + + + diff --git a/doc/quick_start/getting_started_with_Foxy_Ubuntu20.04.md b/doc/quick_start/getting_started_with_Foxy_Ubuntu20.04.md new file mode 100644 index 00000000..0f43cc9f --- /dev/null +++ b/doc/quick_start/getting_started_with_Foxy_Ubuntu20.04.md @@ -0,0 +1,136 @@ +# ROS2_FOXY_OpenVINO_Toolkit + +**NOTE:** +Below steps have been tested on **Ubuntu 20.04**. + +## 1. Environment Setup +* Install ROS2 Foxy ([guide](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html)) +* Install Intel® OpenVINO™ Toolkit Version: 2021.4 ([guide]https://docs.openvino.ai/2021.4/openvino_docs_install_guides_installing_openvino_linux.html)) +* Install Intel® RealSense ™ SDK ([guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md)) + +## 2. Building and Installation +* Install ROS2_OpenVINO packages +``` +mkdir -p ~/catkin_ws/src +cd ~/catkin_ws/src +git clone https://github.com/intel/ros2_openvino_toolkit -b foxy_dev +git clone https://github.com/intel/ros2_object_msgs +git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2 +git clone https://github.com/ros-perception/vision_opencv.git -b ros2 +``` +* Install dependencies +``` +sudo apt-get install ros-foxy-diagnostic-updater +``` +* Build package +``` +source /opt/ros/foxy/setup.bash +source /opt/intel/openvino_2021/bin/setupvars.sh +cd ~/catkin_ws +colcon build --symlink-install +source ./install/local_setup.bash +``` + +## 3. Running the Demo +* Preparation +``` +source /opt/intel/openvino_2021/bin/setupvars.sh +sudo mkdir -p /opt/openvino_toolkit +sudo ln -s /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader /opt/openvino_toolkit/models +sudo chmod 777 -R /opt/openvino_toolkit/models +``` + +* See all available models +``` +cd /opt/intel//deployment_tools/open_model_zoo/tools/downloader +sudo python3 downloader.py --print_all +``` + +* Download the optimized Intermediate Representation (IR) of model (execute once), for example: +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +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 semantic-segmentation-adas-0001 --output_dir /opt/openvino_toolkit/models/semantic-segmentation/output +sudo python3 downloader.py --name vehicle-license-plate-detection-barrier-0106 --output_dir /opt/openvino_toolkit/models/vehicle-license-plate-detection/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 +sudo python3 downloader.py --name person-attributes-recognition-crossroad-0230 --output_dir /opt/openvino_toolkit/models/person-attributes/output +``` + +* 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/ros2_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/ros2_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/ros2_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/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/ + sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/ + 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 +``` + +* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection) +* (Note: Tensorflow=1.15.5, Python<=3.7) + * ssd_mobilenet_v2_coco + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name ssd_mobilenet_v2_coco + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=ssd_mobilenet_v2_coco --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * deeplabv3 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name deeplabv3 + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=deeplabv3 --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * YOLOV2 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name yolo-v2-tf + 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 + ``` + +* 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. + * 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 object segmentation sample code input from Image. + ``` + ros2 launch dynamic_vino_sample pipeline_segmentation_image.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* + diff --git a/doc/quick_start/getting_started_with_Galactic_Ubuntu20.04.md b/doc/quick_start/getting_started_with_Galactic_Ubuntu20.04.md new file mode 100644 index 00000000..1f51b707 --- /dev/null +++ b/doc/quick_start/getting_started_with_Galactic_Ubuntu20.04.md @@ -0,0 +1,136 @@ +# ROS2_GALACTIC_OpenVINO_Toolkit + +**NOTE:** +Below steps have been tested on **Ubuntu 20.04**. + +## 1. Environment Setup +* Install ROS2 Galactic ([guide](https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html)) +* Install Intel® OpenVINO™ Toolkit Version: 2021.4 ([guide](https://docs.openvino.ai/2021.4/openvino_docs_install_guides_installing_openvino_linux.html)) or building by 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)) + +## 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 galactic_dev +git clone https://github.com/intel/ros2_object_msgs +git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2 +git clone https://github.com/ros-perception/vision_opencv.git -b ros2 +``` +* Install dependencies +``` +sudo apt-get install ros-galactic-diagnostic-updater +``` +* Build package +``` +source /opt/ros/galactic/setup.bash +source /opt/intel/openvino_2021/bin/setupvars.sh +cd ~/catkin_ws +colcon build --symlink-install +source ./install/local_setup.bash +``` + +## 3. Running the Demo +* Preparation +``` +source /opt/intel/openvino_2021/bin/setupvars.sh +sudo mkdir -p /opt/openvino_toolkit +sudo ln -s /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader /opt/openvino_toolkit/models +sudo chmod 777 -R /opt/openvino_toolkit/models +``` + +* See all available models +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +sudo python3 downloader.py --print_all +``` + +* Download the optimized Intermediate Representation (IR) of model (execute once), for example: +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +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 semantic-segmentation-adas-0001 --output_dir /opt/openvino_toolkit/models/semantic-segmentation/output +sudo python3 downloader.py --name vehicle-license-plate-detection-barrier-0106 --output_dir /opt/openvino_toolkit/models/vehicle-license-plate-detection/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 +sudo python3 downloader.py --name person-attributes-recognition-crossroad-0230 --output_dir /opt/openvino_toolkit/models/person-attributes/output +``` + +* 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/ros2_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/ros2_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/ros2_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/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/ + sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/ + 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 +``` + +* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection) +* (Note: Tensorflow=1.15.5, Python<=3.7) + * ssd_mobilenet_v2_coco + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name ssd_mobilenet_v2_coco + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=ssd_mobilenet_v2_coco --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * deeplabv3 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name deeplabv3 + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=deeplabv3 --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * YOLOV2 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name yolo-v2-tf + 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 + ``` + +* 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. + * 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 RealSenseCamera. + ``` + ros2 launch dynamic_vino_sample pipeline_segmentation.launch.py + ``` + * run object segmentation sample code input from Image. + ``` + ros2 launch dynamic_vino_sample pipeline_segmentation_image.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* + diff --git a/docker/ros2_2021.4/ros2_dashing/Dockerfile b/docker/ros2_2021.4/ros2_dashing/Dockerfile new file mode 100644 index 00000000..96a60621 --- /dev/null +++ b/docker/ros2_2021.4/ros2_dashing/Dockerfile @@ -0,0 +1,58 @@ +# ros2 openvino toolkit env master f1b1ca4d914186a1881b87f103be9c6e910c9d80 + +from amd64/ros:dashing + +# maintainer information +LABEL maintainer="Pengqiang Li " + +SHELL ["/bin/bash", "-c"] + +# ignore the warning +#ARG DEBIAN_FRONTEND=noninteractive +#RUN apt-get update && apt-get install --assume-yes apt-utils + +# install openvino 2021.4 +# https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_apt.html +RUN apt update && apt install -y curl gnupg2 lsb-release +RUN curl -s https://apt.repos.intel.com/openvino/2021/GPG-PUB-KEY-INTEL-OPENVINO-2021 | apt-key add - +RUN echo "deb https://apt.repos.intel.com/openvino/2021 all main" | tee /etc/apt/sources.list.d/intel-openvino-2021.list +RUN apt update +RUN apt-cache search openvino +RUN apt-get install -y intel-openvino-dev-ubuntu20-2021.4.582 +RUN ls -lh /opt/intel/openvino_2021 +RUN source /opt/intel/openvino_2021/bin/setupvars.sh + +# install librealsense2 +RUN apt-get install -y --no-install-recommends \ +software-properties-common +# https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md +RUN apt-key adv --keyserver-options http-proxy=http://child-prc.intel.com:913/ --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver-options http-proxy=http://child-prc.intel.com:913/ --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE +RUN add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo bionic main" -u \ +&& apt-get install -y --no-install-recommends \ +librealsense2-dkms \ +librealsense2-utils \ +librealsense2-dev \ +librealsense2-dbg \ +libgflags-dev \ +libboost-all-dev \ +&& rm -rf /var/lib/apt/lists/* + +# other dependencies +RUN apt-get update && apt-get install -y python3-pip && python3 -m pip install -U \ +numpy \ +networkx \ +pyyaml \ +requests \ +&& apt-get install -y --no-install-recommends libboost-all-dev +WORKDIR /usr/lib/x86_64-linux-gnu +RUN ln -sf libboost_python-py36.so libboost_python37.so + +# build ros2 openvino toolkit +WORKDIR /root +RUN mkdir -p ros2_ws/src +WORKDIR /root/ros2_ws/src +RUN git clone https://github.com/intel/ros2_object_msgs.git +RUN git clone -b dashing_dev https://github.com/pqLee/ros2_openvino_toolkit.git +RUN git clone -b ros2 https://github.com/ros-perception/vision_opencv.git +WORKDIR /root/ros2_ws +#RUN source /opt/ros/dashing/setup.bash && source /opt/intel/openvino_2021/bin/setupvars.sh && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/docker/ros2_2021.4/ros2_dashing/docker_instraction.md b/docker/ros2_2021.4/ros2_dashing/docker_instraction.md new file mode 100644 index 00000000..48221333 --- /dev/null +++ b/docker/ros2_2021.4/ros2_dashing/docker_instraction.md @@ -0,0 +1,137 @@ +# Run Docker Images For ROS2_OpenVINO_Toolkit + +**NOTE:** +Below steps have been tested on **Ubuntu 18.04**. + +## 1. Environment Setup +* Install docker ([guide](https://docs.docker.com/engine/install/ubuntu/)) + +## 2. Download and load docker image +* Download docker image +``` + # ros2_dashing_openvino_202104_v1.tar for demo + cd ~/Downloads/ + weget https://github.com/intel/ros2_openvino_toolkit/tree/master/DockerImages/ros2_dashing_openvino_202104_v1.tar +``` +* Load docker image +``` +cd ~/Downloads/ +docker load -i ros2_dashing_openvino_202104_v1.tar +docker Images +/// (show ros2_dashing_openvino_202104_v1 images in list) +``` + +## 3. Running the Demos +* Install dependency +``` + sudo apt install x11-xserver-utils + xhost + +``` +* run docker image +``` + docker images + docker run -it -e DISPLAY -e QT_X11_NO_MITSHM=1 -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority --privileged --network=host --device=/dev/video0 ros2_foxy_openvino_202104:v1 /bin/bash +``` +* In Docker Container + +* Preparation +``` +source /opt/intel/openvino_2021/bin/setupvars.sh +sudo mkdir -p /opt/openvino_toolkit +sudo ln -s /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader /opt/openvino_toolkit/models +sudo chmod 777 -R /opt/openvino_toolkit/models +``` + +* See all available models +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +sudo python3 downloader.py --print_all +``` + +* Download the optimized Intermediate Representation (IR) of model (execute once), for example: +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +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 semantic-segmentation-adas-0001 --output_dir /opt/openvino_toolkit/models/semantic-segmentation/output +sudo python3 downloader.py --name vehicle-license-plate-detection-barrier-0106 --output_dir /opt/openvino_toolkit/models/vehicle-license-plate-detection/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 +sudo python3 downloader.py --name person-attributes-recognition-crossroad-0230 --output_dir /opt/openvino_toolkit/models/person-attributes/output +``` + +* 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 /root/ros2_ws/src/ros2_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 /root/ros2_ws/src/ros2_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 /root/ros2_ws/src/ros2_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 /root/ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/ + sudo cp /root/ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/ + sudo cp /root/ros2_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 +``` + +* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection) + * ssd_mobilenet_v2_coco + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name ssd_mobilenet_v2_coco + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=ssd_mobilenet_v2_coco --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * deeplabv3 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name deeplabv3 + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=deeplabv3 --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * YOLOV2 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name yolo-v2-tf + 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 + ``` + +* 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. + * 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 object segmentation sample code input from Image. + ``` + ros2 launch dynamic_vino_sample pipeline_segmentation_image.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* + diff --git a/docker/ros2_2021.4/ros2_foxy/Dockerfile b/docker/ros2_2021.4/ros2_foxy/Dockerfile new file mode 100644 index 00000000..67fb5780 --- /dev/null +++ b/docker/ros2_2021.4/ros2_foxy/Dockerfile @@ -0,0 +1,43 @@ +# ros2 openvino toolkit env master f1b1ca4d914186a1881b87f103be9c6e910c9d80 + +from osrf/ros:foxy-desktop + +# maintainer information +LABEL maintainer="Pengqiang Li " + +SHELL ["/bin/bash", "-c"] + +# install openvino 2021.4 +# https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_apt.html +RUN apt update && apt install curl gnupg2 lsb-release +RUN curl -s https://apt.repos.intel.com/openvino/2021/GPG-PUB-KEY-INTEL-OPENVINO-2021 |apt-key add - +RUN echo "deb https://apt.repos.intel.com/openvino/2021 all main" | tee /etc/apt/sources.list.d/intel-openvino-2021.list +RUN apt update +RUN apt-cache search openvino +RUN apt-get install -y intel-openvino-dev-ubuntu20-2021.4.582 +RUN ls -lh /opt/intel/openvino_2021 +RUN source /opt/intel/openvino_2021/bin/setupvars.sh + +# install librealsense2 +RUN apt-get install -y --no-install-recommends \ +software-properties-common +# https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md +RUN apt-key adv --keyserver-options http-proxy=http://child-prc.intel.com:913/ --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver-options http-proxy=http://child-prc.intel.com:913/ --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE +RUN add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo focal main" -u \ +&& apt-get install -y --no-install-recommends \ +librealsense2-dkms \ +librealsense2-utils \ +librealsense2-dev \ +librealsense2-dbg \ +libgflags-dev \ +&& rm -rf /var/lib/apt/lists/* + +# build ros2 openvino toolkit +WORKDIR /root +RUN mkdir -p ros2_ws/src +WORKDIR /root/ros2_ws/src +RUN git clone https://github.com/intel/ros2_object_msgs.git +RUN git clone -b foxy_dev https://github.com/pqLee/ros2_openvino_toolkit.git +RUN git clone -b ros2 https://github.com/ros-perception/vision_opencv.git +WORKDIR /root/ros2_ws +RUN source /opt/ros/foxy/setup.bash && source /opt/intel/openvino_2021/bin/setupvars.sh && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/docker/ros2_2021.4/ros2_foxy/docker_instraction.md b/docker/ros2_2021.4/ros2_foxy/docker_instraction.md new file mode 100644 index 00000000..2515ec3c --- /dev/null +++ b/docker/ros2_2021.4/ros2_foxy/docker_instraction.md @@ -0,0 +1,137 @@ +# Run Docker Images For ROS2_OpenVINO_Toolkit + +**NOTE:** +Below steps have been tested on **Ubuntu 20.04**. + +## 1. Environment Setup +* Install docker ([guide](https://docs.docker.com/engine/install/ubuntu/)) + +## 2. Download and load docker image +* Download docker image +``` + # ros2_foxy_openvino_202104_v1.tar for demo + cd ~/Downloads/ + weget https://github.com/intel/ros2_openvino_toolkit/tree/master/DockerImages/ros2_foxy_openvino_202104_v1.tar +``` +* Load docker image +``` +cd ~/Downloads/ +docker load -i ros2_foxy_openvino_202104_v1.tar +docker Images +/// (show ros2_foxy_openvino_202104_v1 images in list) +``` + +## 3. Running the Demos +* Install dependency +``` + sudo apt install x11-xserver-utils + xhost + +``` +* run docker image +``` + docker images + docker run -it -e DISPLAY -e QT_X11_NO_MITSHM=1 -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority --privileged --network=host --device=/dev/video0 ros2_foxy_openvino_202104:v1 /bin/bash +``` +* In Docker Container + +* Preparation +``` +source /opt/intel/openvino_2021/bin/setupvars.sh +sudo mkdir -p /opt/openvino_toolkit +sudo ln -s /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader /opt/openvino_toolkit/models +sudo chmod 777 -R /opt/openvino_toolkit/models +``` + +* See all available models +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +sudo python3 downloader.py --print_all +``` + +* Download the optimized Intermediate Representation (IR) of model (execute once), for example: +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +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 semantic-segmentation-adas-0001 --output_dir /opt/openvino_toolkit/models/semantic-segmentation/output +sudo python3 downloader.py --name vehicle-license-plate-detection-barrier-0106 --output_dir /opt/openvino_toolkit/models/vehicle-license-plate-detection/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 +sudo python3 downloader.py --name person-attributes-recognition-crossroad-0230 --output_dir /opt/openvino_toolkit/models/person-attributes/output +``` + +* 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 /root/ros2_ws/src/ros2_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 /root/ros2_ws/src/ros2_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 /root/ros2_ws/src/ros2_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 /root/ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/ + sudo cp /root/ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/ + sudo cp /root/ros2_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 +``` + +* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection) + * ssd_mobilenet_v2_coco + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name ssd_mobilenet_v2_coco + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=ssd_mobilenet_v2_coco --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * deeplabv3 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name deeplabv3 + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=deeplabv3 --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * YOLOV2 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name yolo-v2-tf + 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 + ``` + +* 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. + * 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 object segmentation sample code input from Image. + ``` + ros2 launch dynamic_vino_sample pipeline_segmentation_image.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* + diff --git a/docker/ros2_2021.4/ros2_galactic/Dockerfile b/docker/ros2_2021.4/ros2_galactic/Dockerfile new file mode 100644 index 00000000..755a5ad6 --- /dev/null +++ b/docker/ros2_2021.4/ros2_galactic/Dockerfile @@ -0,0 +1,47 @@ +# ros2 openvino toolkit env master f1b1ca4d914186a1881b87f103be9c6e910c9d80 + +from osrf/ros:galactic-desktop + +# setting proxy env --option +ENV http_proxy=http://child-prc.intel.com:913 +ENV https_proxy=http://child-prc.intel.com:913 + +# maintainer information +LABEL maintainer="Pengqiang Li " + +SHELL ["/bin/bash", "-c"] + +# install openvino 2021.4 +# https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_apt.html +RUN apt update && apt install curl gnupg2 lsb-release +RUN curl -s https://apt.repos.intel.com/openvino/2021/GPG-PUB-KEY-INTEL-OPENVINO-2021 |apt-key add - +RUN echo "deb https://apt.repos.intel.com/openvino/2021 all main" | tee /etc/apt/sources.list.d/intel-openvino-2021.list +RUN apt update +RUN apt-cache search openvino +RUN apt-get install -y intel-openvino-dev-ubuntu20-2021.4.582 +RUN ls -lh /opt/intel/openvino_2021 +RUN source /opt/intel/openvino_2021/bin/setupvars.sh + +# install librealsense2 +RUN apt-get install -y --no-install-recommends \ +software-properties-common +# https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md +RUN apt-key adv --keyserver-options http-proxy=http://child-prc.intel.com:913/ --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver-options http-proxy=http://child-prc.intel.com:913/ --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE +RUN add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo focal main" -u \ +&& apt-get install -y --no-install-recommends \ +librealsense2-dkms \ +librealsense2-utils \ +librealsense2-dev \ +librealsense2-dbg \ +libgflags-dev \ +&& rm -rf /var/lib/apt/lists/* + +# build ros2 openvino toolkit +WORKDIR /root +RUN mkdir -p ros2_ws/src +WORKDIR /root/ros2_ws/src +RUN git clone https://github.com/intel/ros2_object_msgs.git +RUN git clone -b galactic_dev https://github.com/pqLee/ros2_openvino_toolkit.git +RUN git clone -b ros2 https://github.com/ros-perception/vision_opencv.git +WORKDIR /root/ros2_ws +RUN source /opt/ros/galactic/setup.bash && source /opt/intel/openvino_2021/bin/setupvars.sh && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/docker/ros2_2021.4/ros2_galactic/docker_instraction.md b/docker/ros2_2021.4/ros2_galactic/docker_instraction.md new file mode 100644 index 00000000..efcd4857 --- /dev/null +++ b/docker/ros2_2021.4/ros2_galactic/docker_instraction.md @@ -0,0 +1,137 @@ +# Run Docker Images For ROS2_OpenVINO_Toolkit + +**NOTE:** +Below steps have been tested on **Ubuntu 20.04**. + +## 1. Environment Setup +* Install docker ([guide](https://docs.docker.com/engine/install/ubuntu/)) + +## 2. Download and load docker image +* Download docker image +``` + # ros2_galactic_openvino_202104_v1.tar for demo + cd ~/Downloads/ + weget https://github.com/intel/ros2_openvino_toolkit/tree/master/DockerImages/ros2_galactic_openvino_202104_v1.tar +``` +* Load docker image +``` +cd ~/Downloads/ +docker load -i ros2_galactic_openvino_202104_v1.tar +docker Images +/// (show ros2_galactic_openvino_202104_v1 images in list) +``` + +## 3. Running the Demos +* Install dependency +``` + sudo apt install x11-xserver-utils + xhost + +``` +* run docker image +``` + docker images + docker run -it -e DISPLAY -e QT_X11_NO_MITSHM=1 -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority --privileged --network=host --device=/dev/video0 ros2_foxy_openvino_202104:v1 /bin/bash +``` +* In Docker Container + +* Preparation +``` +source /opt/intel/openvino_2021/bin/setupvars.sh +sudo mkdir -p /opt/openvino_toolkit +sudo ln -s /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader /opt/openvino_toolkit/models +sudo chmod 777 -R /opt/openvino_toolkit/models +``` + +* See all available models +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +sudo python3 downloader.py --print_all +``` + +* Download the optimized Intermediate Representation (IR) of model (execute once), for example: +``` +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader +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 semantic-segmentation-adas-0001 --output_dir /opt/openvino_toolkit/models/semantic-segmentation/output +sudo python3 downloader.py --name vehicle-license-plate-detection-barrier-0106 --output_dir /opt/openvino_toolkit/models/vehicle-license-plate-detection/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 +sudo python3 downloader.py --name person-attributes-recognition-crossroad-0230 --output_dir /opt/openvino_toolkit/models/person-attributes/output +``` + +* 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 /root/ros2_ws/src/ros2_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 /root/ros2_ws/src/ros2_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 /root/ros2_ws/src/ros2_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 /root/ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/ + sudo cp /root/ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/ + sudo cp /root/ros2_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 +``` + +* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection) + * ssd_mobilenet_v2_coco + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name ssd_mobilenet_v2_coco + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=ssd_mobilenet_v2_coco --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * deeplabv3 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name deeplabv3 + sudo python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader/converter.py --name=deeplabv3 --mo /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py + ``` + * YOLOV2 + ``` + cd /opt/openvino_toolkit/models/ + sudo python3 downloader/downloader.py --name yolo-v2-tf + 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 + ``` + +* 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. + * 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 object segmentation sample code input from Image. + ``` + ros2 launch dynamic_vino_sample pipeline_segmentation_image.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* +