|
| 1 | +# ROS2_FOXY_OpenVINO_Toolkit |
| 2 | + |
| 3 | +**NOTE:** |
| 4 | +Below steps have been tested on **Ubuntu 20.04**. |
| 5 | + |
| 6 | +## 1. Environment Setup |
| 7 | +* Install ROS2 Foxy ([guide](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html)) |
| 8 | +* Install Intel® OpenVINO™ Toolkit Version: 2021.4 ([guide]https://docs.openvino.ai/2021.4/openvino_docs_install_guides_installing_openvino_linux.html)) |
| 9 | +* Install Intel® RealSense ™ SDK ([guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md)) |
| 10 | + |
| 11 | +## 2. Building and Installation |
| 12 | +* Install ROS2_OpenVINO packages |
| 13 | +``` |
| 14 | +mkdir -p ~/catkin_ws/src |
| 15 | +cd ~/catkin_ws/src |
| 16 | +git clone https://github.com/intel/ros2_openvino_toolkit -b foxy_dev |
| 17 | +git clone https://github.com/intel/ros2_object_msgs |
| 18 | +git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2 |
| 19 | +git clone https://github.com/ros-perception/vision_opencv.git -b ros2 |
| 20 | +``` |
| 21 | +* Install dependencies |
| 22 | +``` |
| 23 | +sudo apt-get install ros-foxy-diagnostic-updater |
| 24 | +``` |
| 25 | +* Build package |
| 26 | +``` |
| 27 | +source /opt/ros/foxy/setup.bash |
| 28 | +source /opt/intel/openvino_2021/bin/setupvars.sh |
| 29 | +cd ~/catkin_ws |
| 30 | +colcon build --symlink-install |
| 31 | +source ./install/local_setup.bash |
| 32 | +``` |
| 33 | + |
| 34 | +## 3. Running the Demo |
| 35 | +* Preparation |
| 36 | +``` |
| 37 | +source /opt/intel/openvino_2021/bin/setupvars.sh |
| 38 | +sudo mkdir -p /opt/openvino_toolkit |
| 39 | +sudo ln -s /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader /opt/openvino_toolkit/models |
| 40 | +sudo chmod 777 -R /opt/openvino_toolkit/models |
| 41 | +``` |
| 42 | + |
| 43 | +* See all available models |
| 44 | +``` |
| 45 | +cd /opt/intel/<INSTALL_DIR>/deployment_tools/open_model_zoo/tools/downloader |
| 46 | +sudo python3 downloader.py --print_all |
| 47 | +``` |
| 48 | + |
| 49 | +* Download the optimized Intermediate Representation (IR) of model (execute once), for example: |
| 50 | +``` |
| 51 | +cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader |
| 52 | +sudo python3 downloader.py --name face-detection-adas-0001 --output_dir /opt/openvino_toolkit/models/face_detection/output |
| 53 | +sudo python3 downloader.py --name age-gender-recognition-retail-0013 --output_dir /opt/openvino_toolkit/models/age-gender-recognition/output |
| 54 | +sudo python3 downloader.py --name emotions-recognition-retail-0003 --output_dir /opt/openvino_toolkit/models/emotions-recognition/output |
| 55 | +sudo python3 downloader.py --name head-pose-estimation-adas-0001 --output_dir /opt/openvino_toolkit/models/head-pose-estimation/output |
| 56 | +sudo python3 downloader.py --name person-detection-retail-0013 --output_dir /opt/openvino_toolkit/models/person-detection/output |
| 57 | +sudo python3 downloader.py --name person-reidentification-retail-0277 --output_dir /opt/openvino_toolkit/models/person-reidentification/output |
| 58 | +sudo python3 downloader.py --name landmarks-regression-retail-0009 --output_dir /opt/openvino_toolkit/models/landmarks-regression/output |
| 59 | +sudo python3 downloader.py --name semantic-segmentation-adas-0001 --output_dir /opt/openvino_toolkit/models/semantic-segmentation/output |
| 60 | +sudo python3 downloader.py --name vehicle-license-plate-detection-barrier-0106 --output_dir /opt/openvino_toolkit/models/vehicle-license-plate-detection/output |
| 61 | +sudo python3 downloader.py --name vehicle-attributes-recognition-barrier-0039 --output_dir /opt/openvino_toolkit/models/vehicle-attributes-recognition/output |
| 62 | +sudo python3 downloader.py --name license-plate-recognition-barrier-0001 --output_dir /opt/openvino_toolkit/models/license-plate-recognition/output |
| 63 | +sudo python3 downloader.py --name person-attributes-recognition-crossroad-0230 --output_dir /opt/openvino_toolkit/models/person-attributes/output |
| 64 | +``` |
| 65 | + |
| 66 | +* copy label files (execute once) |
| 67 | +* 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. |
| 68 | +``` |
| 69 | + 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/ |
| 70 | + 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/ |
| 71 | + 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/ |
| 72 | + sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/ |
| 73 | + sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/ |
| 74 | + 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 |
| 75 | +``` |
| 76 | + |
| 77 | +* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection) |
| 78 | +* (Note: Tensorflow=1.15.5, Python<=3.7) |
| 79 | + * ssd_mobilenet_v2_coco |
| 80 | + ``` |
| 81 | + cd /opt/openvino_toolkit/models/ |
| 82 | + sudo python3 downloader/downloader.py --name ssd_mobilenet_v2_coco |
| 83 | + 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 |
| 84 | + ``` |
| 85 | + * deeplabv3 |
| 86 | + ``` |
| 87 | + cd /opt/openvino_toolkit/models/ |
| 88 | + sudo python3 downloader/downloader.py --name deeplabv3 |
| 89 | + 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 |
| 90 | + ``` |
| 91 | + * YOLOV2 |
| 92 | + ``` |
| 93 | + cd /opt/openvino_toolkit/models/ |
| 94 | + sudo python3 downloader/downloader.py --name yolo-v2-tf |
| 95 | + 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 |
| 96 | + ``` |
| 97 | + |
| 98 | +* 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. |
| 99 | + * run face detection sample code input from StandardCamera. |
| 100 | + ``` |
| 101 | + ros2 launch dynamic_vino_sample pipeline_people.launch.py |
| 102 | + ``` |
| 103 | + * run person reidentification sample code input from StandardCamera. |
| 104 | + ``` |
| 105 | + ros2 launch dynamic_vino_sample pipeline_reidentification.launch.py |
| 106 | + ``` |
| 107 | + * run person face reidentification sample code input from RealSenseCamera. |
| 108 | + ``` |
| 109 | + ros2 launch dynamic_vino_sample pipeline_face_reidentification.launch.py |
| 110 | + ``` |
| 111 | + * run face detection sample code input from Image. |
| 112 | + ``` |
| 113 | + ros2 launch dynamic_vino_sample pipeline_image.launch.py |
| 114 | + ``` |
| 115 | + * run object segmentation sample code input from RealSenseCameraTopic. |
| 116 | + ``` |
| 117 | + ros2 launch dynamic_vino_sample pipeline_segmentation.launch.py |
| 118 | + ``` |
| 119 | + * run object segmentation sample code input from Image. |
| 120 | + ``` |
| 121 | + ros2 launch dynamic_vino_sample pipeline_segmentation_image.launch.py |
| 122 | + ``` |
| 123 | + * run vehicle detection sample code input from StandardCamera. |
| 124 | + ``` |
| 125 | + ros2 launch dynamic_vino_sample pipeline_vehicle_detection.launch.py |
| 126 | + ``` |
| 127 | + * run person attributes sample code input from StandardCamera. |
| 128 | + ``` |
| 129 | + ros2 launch dynamic_vino_sample pipeline_person_attributes.launch.py |
| 130 | + ``` |
| 131 | + |
| 132 | +# More Information |
| 133 | +* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw |
| 134 | + |
| 135 | +###### *Any security issue should be reported using process at https://01.org/security* |
| 136 | + |
0 commit comments