From f1388a0c57fcc94262c3567c7ac68ae28635dd5a Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 8 Sep 2021 15:03:01 +0800 Subject: [PATCH 1/9] ov2021.4 and galactic --- README.md | 12 +- ...tting_started_with_Galactic_Ubuntu20.04.md | 117 ++++++++++++++++++ sample/src/image_object_client.cpp | 2 +- sample/src/image_people_client.cpp | 2 +- tests/CMakeLists.txt | 2 +- tests/src/service/unittest_objectService.cpp | 2 +- tests/src/service/unittest_peopleService.cpp | 2 +- .../src/topic/unittest_faceDetectionCheck.cpp | 6 +- .../topic/unittest_face_reidentification.cpp | 6 +- tests/src/topic/unittest_imageCheck.cpp | 6 +- .../topic/unittest_objectDetectionCheck.cpp | 6 +- tests/src/topic/unittest_reidentification.cpp | 6 +- .../src/topic/unittest_segmentationCheck.cpp | 6 +- .../topic/unittest_vehicleDetectionCheck.cpp | 6 +- 14 files changed, 149 insertions(+), 32 deletions(-) create mode 100644 doc/getting_started_with_Galactic_Ubuntu20.04.md diff --git a/README.md b/README.md index 5014857c..26f481e0 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ ROS2 Version supported: * [x] ROS2 Dashing * [x] ROS2 Eloquent * [x] ROS2 Foxy +* [x] ROS2 Galactic Inference Features supported: @@ -26,10 +27,10 @@ See more from [here](https://github.com/openvinotoolkit/openvino) for Intel Open ## Prerequisite -* Processor: A platform with Intel processors assembled. (see [here](https://software.intel.com/content/www/us/en/develop/articles/openvino-2020-3-lts-relnotes.html) for the full list of Intel processors supported.) +* Processor: A platform with Intel processors assembled. (see [here](https://software.intel.com/content/www/us/en/develop/articles/openvino-2021-4-lts-relnotes.html) for the full list of Intel processors supported.) * OS: Ubuntu 20.04 -* ROS2: Foxy Fitzroy -* OpenVINO: V2021.3, see [the release notes](https://software.intel.com/content/www/us/en/develop/articles/openvino-relnotes.html) for more info. +* ROS2: Galactic Geochelone +* OpenVINO: V2021.4, see [the release notes](https://software.intel.com/content/www/us/en/develop/articles/openvino-relnotes.html) for more info. * [Optional] RealSense D400 Series Camera * [Optional] Intel NCS2 Stick ## Tables of contents @@ -40,10 +41,9 @@ See more from [here](https://github.com/openvinotoolkit/openvino) for Intel Open - [How to create multiple pipelines in a process?](./doc/tables_of_contents/tutorials/Multiple_Pipelines.md) ## Installation & Launching -See Getting Start Pages for [ROS2 Dashing](./doc/getting_started_with_Dashing.md) or [ROS2 Foxy](./doc/getting_started_with_Foxy_Ubuntu20.04.md) for detailed installation & lauching instructions. +See Getting Start Pages for [ROS2 Dashing](./doc/getting_started_with_Dashing.md) or [ROS2 Foxy](./doc/getting_started_with_Foxy_Ubuntu20.04.md) or [ROS2 Galactic](./doc/getting_started_with_Galactic_Ubuntu20.04.md) for detailed installation & lauching instructions. # More Information -* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw +* 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/getting_started_with_Galactic_Ubuntu20.04.md b/doc/getting_started_with_Galactic_Ubuntu20.04.md new file mode 100644 index 00000000..f0f4b05f --- /dev/null +++ b/doc/getting_started_with_Galactic_Ubuntu20.04.md @@ -0,0 +1,117 @@ +# ROS2_GALACTIC_OpenVINO_Toolkit + +**NOTE:** +Below steps have been tested on **Ubuntu 20.04**. + +## 1. Environment Setup +* Install ROS2 Foxy ([guide](https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html)) +* Install Intel® OpenVINO™ Toolkit Version: 2021.4 ([guide](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_apt.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 +* Build demo code in OpenVINO toolkit +``` + # root is required instead of sudo + source /opt/intel//bin/setupvars.sh + cd /opt/intel//deployment_tools/open_model_zoo/demos + source build_demos.sh +``` +* Install ROS2_OpenVINO packages +``` +mkdir -p ~/my_ros2_ws/src +cd ~/my_ros2_ws/src +git clone https://github.com/intel/ros2_openvino_toolkit -b dev-ov.2021.4 +git clone https://github.com/intel/ros2_object_msgs +git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2 +``` +* Build package +``` +source ~/ros2_foxy/install/local_setup.bash +source /opt/intel//bin/setupvars.sh +cd ~/my_ros2_ws/src +colcon build --symlink-install +source ./install/local_setup.bash +``` + +## 3. Running the Demo +* Preparation + * Configure the Neural Compute Stick USB Driver (if needed) +``` + cd ~/Downloads + cat < 97-usbboot.rules + SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" + SUBSYSTEM=="usb", ATTRS{idProduct}=="2485", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" + SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" + EOF + sudo cp 97-usbboot.rules /etc/udev/rules.d/ + sudo udevadm control --reload-rules + sudo udevadm trigger + sudo ldconfig + rm 97-usbboot.rules +``` + +* 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//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 +``` + +* copy label files (execute once) +``` + sudo cp ~/my_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 ~/my_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 ~/my_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 ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/ + sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/ + sudo cp ~/my_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 + sudo cp ~/my_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 ~/my_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/ +``` + +* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection) +``` + sudo python3 downloader.py --name mobilenet-ssd --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output + cd /opt/intel//deployment_tools/model_optimizer + sudo python3 mo.py --input_model /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output/public/mobilenet-ssd/mobilenet-ssd.caffemodel --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output +``` + +* 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 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 +``` +* run person reidentification sample code input from StandardCamera. +``` +ros2 launch dynamic_vino_sample pipeline_reidentification.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/sample/src/image_object_client.cpp b/sample/src/image_object_client.cpp index 3c507b3d..4d58ef72 100644 --- a/sample/src/image_object_client.cpp +++ b/sample/src/image_object_client.cpp @@ -48,7 +48,7 @@ int main(int argc, char ** argv) auto result = client->async_send_request(request); if (rclcpp::spin_until_future_complete(node, result) == - rclcpp::executor::FutureReturnCode::SUCCESS) + rclcpp::FutureReturnCode::SUCCESS) { auto srv = result.get(); diff --git a/sample/src/image_people_client.cpp b/sample/src/image_people_client.cpp index eba31b91..21adda4f 100644 --- a/sample/src/image_people_client.cpp +++ b/sample/src/image_people_client.cpp @@ -52,7 +52,7 @@ int main(int argc, char ** argv) auto result = client->async_send_request(request); if (rclcpp::spin_until_future_complete(node, result) == - rclcpp::executor::FutureReturnCode::SUCCESS) + rclcpp::FutureReturnCode::SUCCESS) { auto people = result.get(); if (people->persons.emotions.size() == 0 && people->persons.agegenders.size() == 0 && diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4d3b2648..59509625 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -26,7 +26,7 @@ set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}") #################################### message(STATUS "Looking for inference engine configuration file at: ${CMAKE_PREFIX_PATH}") -find_package(InferenceEngine 1.1) +find_package(InferenceEngine) if(NOT InferenceEngine_FOUND) message(FATAL_ERROR "") endif() diff --git a/tests/src/service/unittest_objectService.cpp b/tests/src/service/unittest_objectService.cpp index 6cddbb3c..90b66a12 100644 --- a/tests/src/service/unittest_objectService.cpp +++ b/tests/src/service/unittest_objectService.cpp @@ -49,7 +49,7 @@ TEST(UnitTestObject, testObject) auto result = client->async_send_request(request); ASSERT_EQ( - rclcpp::executor::FutureReturnCode::SUCCESS, + rclcpp::FutureReturnCode::SUCCESS, rclcpp::spin_until_future_complete(node, result)); auto srv = result.get(); diff --git a/tests/src/service/unittest_peopleService.cpp b/tests/src/service/unittest_peopleService.cpp index 7b6bbd2f..7e944ecc 100644 --- a/tests/src/service/unittest_peopleService.cpp +++ b/tests/src/service/unittest_peopleService.cpp @@ -51,7 +51,7 @@ TEST(UnitTestPeople, testPeople) auto result = client->async_send_request(request); ASSERT_EQ( - rclcpp::executor::FutureReturnCode::SUCCESS, + rclcpp::FutureReturnCode::SUCCESS, rclcpp::spin_until_future_complete(node, result)); auto srv = result.get(); diff --git a/tests/src/topic/unittest_faceDetectionCheck.cpp b/tests/src/topic/unittest_faceDetectionCheck.cpp index 0b5eb8ad..95fc2118 100644 --- a/tests/src/topic/unittest_faceDetectionCheck.cpp +++ b/tests/src/topic/unittest_faceDetectionCheck.cpp @@ -51,11 +51,11 @@ static bool headPose_test_pass = false; template void wait_for_future( - rclcpp::executor::Executor & executor, std::shared_future & future, + rclcpp::Executor & executor, std::shared_future & future, const DurationT & timeout) { - using rclcpp::executor::FutureReturnCode; - rclcpp::executor::FutureReturnCode future_ret; + using rclcpp::FutureReturnCode; + rclcpp::FutureReturnCode future_ret; auto start_time = std::chrono::steady_clock::now(); future_ret = executor.spin_until_future_complete(future, timeout); auto elapsed_time = std::chrono::steady_clock::now() - start_time; diff --git a/tests/src/topic/unittest_face_reidentification.cpp b/tests/src/topic/unittest_face_reidentification.cpp index 6fb61c70..395e1bb4 100644 --- a/tests/src/topic/unittest_face_reidentification.cpp +++ b/tests/src/topic/unittest_face_reidentification.cpp @@ -50,11 +50,11 @@ static bool test_pass = false; template void wait_for_future( - rclcpp::executor::Executor & executor, std::shared_future & future, + rclcpp::Executor & executor, std::shared_future & future, const DurationT & timeout) { - using rclcpp::executor::FutureReturnCode; - rclcpp::executor::FutureReturnCode future_ret; + using rclcpp::FutureReturnCode; + rclcpp::FutureReturnCode future_ret; auto start_time = std::chrono::steady_clock::now(); future_ret = executor.spin_until_future_complete(future, timeout); auto elapsed_time = std::chrono::steady_clock::now() - start_time; diff --git a/tests/src/topic/unittest_imageCheck.cpp b/tests/src/topic/unittest_imageCheck.cpp index c4af8e74..7f4a333a 100644 --- a/tests/src/topic/unittest_imageCheck.cpp +++ b/tests/src/topic/unittest_imageCheck.cpp @@ -51,11 +51,11 @@ static bool headPose_test_pass = false; template void wait_for_future( - rclcpp::executor::Executor & executor, std::shared_future & future, + rclcpp::Executor & executor, std::shared_future & future, const DurationT & timeout) { - using rclcpp::executor::FutureReturnCode; - rclcpp::executor::FutureReturnCode future_ret; + using rclcpp::FutureReturnCode; + rclcpp::FutureReturnCode future_ret; auto start_time = std::chrono::steady_clock::now(); future_ret = executor.spin_until_future_complete(future, timeout); auto elapsed_time = std::chrono::steady_clock::now() - start_time; diff --git a/tests/src/topic/unittest_objectDetectionCheck.cpp b/tests/src/topic/unittest_objectDetectionCheck.cpp index 569c8557..ad5facf2 100644 --- a/tests/src/topic/unittest_objectDetectionCheck.cpp +++ b/tests/src/topic/unittest_objectDetectionCheck.cpp @@ -43,11 +43,11 @@ static bool test_pass = false; template void wait_for_future( - rclcpp::executor::Executor & executor, std::shared_future & future, + rclcpp::Executor & executor, std::shared_future & future, const DurationT & timeout) { - using rclcpp::executor::FutureReturnCode; - rclcpp::executor::FutureReturnCode future_ret; + using rclcpp::FutureReturnCode; + rclcpp::FutureReturnCode future_ret; auto start_time = std::chrono::steady_clock::now(); future_ret = executor.spin_until_future_complete(future, timeout); auto elapsed_time = std::chrono::steady_clock::now() - start_time; diff --git a/tests/src/topic/unittest_reidentification.cpp b/tests/src/topic/unittest_reidentification.cpp index b3393fa6..05c10b11 100644 --- a/tests/src/topic/unittest_reidentification.cpp +++ b/tests/src/topic/unittest_reidentification.cpp @@ -46,11 +46,11 @@ static bool test_pass = false; template void wait_for_future( - rclcpp::executor::Executor & executor, std::shared_future & future, + rclcpp::Executor & executor, std::shared_future & future, const DurationT & timeout) { - using rclcpp::executor::FutureReturnCode; - rclcpp::executor::FutureReturnCode future_ret; + using rclcpp::FutureReturnCode; + rclcpp::FutureReturnCode future_ret; auto start_time = std::chrono::steady_clock::now(); future_ret = executor.spin_until_future_complete(future, timeout); auto elapsed_time = std::chrono::steady_clock::now() - start_time; diff --git a/tests/src/topic/unittest_segmentationCheck.cpp b/tests/src/topic/unittest_segmentationCheck.cpp index 28fdc8fd..52d6e278 100644 --- a/tests/src/topic/unittest_segmentationCheck.cpp +++ b/tests/src/topic/unittest_segmentationCheck.cpp @@ -44,11 +44,11 @@ static bool test_pass = false; template void wait_for_future( - rclcpp::executor::Executor & executor, std::shared_future & future, + rclcpp::Executor & executor, std::shared_future & future, const DurationT & timeout) { - using rclcpp::executor::FutureReturnCode; - rclcpp::executor::FutureReturnCode future_ret; + using rclcpp::FutureReturnCode; + rclcpp::FutureReturnCode future_ret; auto start_time = std::chrono::steady_clock::now(); future_ret = executor.spin_until_future_complete(future, timeout); auto elapsed_time = std::chrono::steady_clock::now() - start_time; diff --git a/tests/src/topic/unittest_vehicleDetectionCheck.cpp b/tests/src/topic/unittest_vehicleDetectionCheck.cpp index 777b3242..e325ba31 100644 --- a/tests/src/topic/unittest_vehicleDetectionCheck.cpp +++ b/tests/src/topic/unittest_vehicleDetectionCheck.cpp @@ -48,11 +48,11 @@ static bool test_pass = false; template void wait_for_future( - rclcpp::executor::Executor & executor, std::shared_future & future, + rclcpp::Executor & executor, std::shared_future & future, const DurationT & timeout) { - using rclcpp::executor::FutureReturnCode; - rclcpp::executor::FutureReturnCode future_ret; + using rclcpp::FutureReturnCode; + rclcpp::FutureReturnCode future_ret; auto start_time = std::chrono::steady_clock::now(); future_ret = executor.spin_until_future_complete(future, timeout); auto elapsed_time = std::chrono::steady_clock::now() - start_time; From 2c9f3f2cfac9d052aa09e2a62a4d78135eed3aed Mon Sep 17 00:00:00 2001 From: beathx <970286550@qq.com> Date: Wed, 8 Sep 2021 10:33:39 +0800 Subject: [PATCH 2/9] Update getting_started_with_Galactic_Ubuntu20.04.md --- doc/getting_started_with_Galactic_Ubuntu20.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/getting_started_with_Galactic_Ubuntu20.04.md b/doc/getting_started_with_Galactic_Ubuntu20.04.md index f0f4b05f..a2dd074a 100644 --- a/doc/getting_started_with_Galactic_Ubuntu20.04.md +++ b/doc/getting_started_with_Galactic_Ubuntu20.04.md @@ -4,7 +4,7 @@ Below steps have been tested on **Ubuntu 20.04**. ## 1. Environment Setup -* Install ROS2 Foxy ([guide](https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html)) +* 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.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_apt.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)) From 527fc74458e9a2df5898b4e12de0d5a7d5b1e320 Mon Sep 17 00:00:00 2001 From: beathx <970286550@qq.com> Date: Wed, 8 Sep 2021 10:36:10 +0800 Subject: [PATCH 3/9] Update getting_started_with_Galactic_Ubuntu20.04.md --- doc/getting_started_with_Galactic_Ubuntu20.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/getting_started_with_Galactic_Ubuntu20.04.md b/doc/getting_started_with_Galactic_Ubuntu20.04.md index a2dd074a..587eeccb 100644 --- a/doc/getting_started_with_Galactic_Ubuntu20.04.md +++ b/doc/getting_started_with_Galactic_Ubuntu20.04.md @@ -26,7 +26,7 @@ git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2 ``` * Build package ``` -source ~/ros2_foxy/install/local_setup.bash +source /opt/ros/galactic/setup.bash source /opt/intel//bin/setupvars.sh cd ~/my_ros2_ws/src colcon build --symlink-install From f59f6c3025eb131d8bc8f549ed142ecf278fd655 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 2 Dec 2021 15:16:05 +0800 Subject: [PATCH 4/9] Galactic commit --- README.md | 12 +- ...tting_started_with_Galactic_Ubuntu20.04.md | 117 ------------------ docker/Dockerfile | 35 ------ 3 files changed, 6 insertions(+), 158 deletions(-) delete mode 100644 doc/getting_started_with_Galactic_Ubuntu20.04.md delete mode 100644 docker/Dockerfile diff --git a/README.md b/README.md index 26f481e0..5014857c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ ROS2 Version supported: * [x] ROS2 Dashing * [x] ROS2 Eloquent * [x] ROS2 Foxy -* [x] ROS2 Galactic Inference Features supported: @@ -27,10 +26,10 @@ See more from [here](https://github.com/openvinotoolkit/openvino) for Intel Open ## Prerequisite -* Processor: A platform with Intel processors assembled. (see [here](https://software.intel.com/content/www/us/en/develop/articles/openvino-2021-4-lts-relnotes.html) for the full list of Intel processors supported.) +* Processor: A platform with Intel processors assembled. (see [here](https://software.intel.com/content/www/us/en/develop/articles/openvino-2020-3-lts-relnotes.html) for the full list of Intel processors supported.) * OS: Ubuntu 20.04 -* ROS2: Galactic Geochelone -* OpenVINO: V2021.4, see [the release notes](https://software.intel.com/content/www/us/en/develop/articles/openvino-relnotes.html) for more info. +* ROS2: Foxy Fitzroy +* OpenVINO: V2021.3, see [the release notes](https://software.intel.com/content/www/us/en/develop/articles/openvino-relnotes.html) for more info. * [Optional] RealSense D400 Series Camera * [Optional] Intel NCS2 Stick ## Tables of contents @@ -41,9 +40,10 @@ See more from [here](https://github.com/openvinotoolkit/openvino) for Intel Open - [How to create multiple pipelines in a process?](./doc/tables_of_contents/tutorials/Multiple_Pipelines.md) ## Installation & Launching -See Getting Start Pages for [ROS2 Dashing](./doc/getting_started_with_Dashing.md) or [ROS2 Foxy](./doc/getting_started_with_Foxy_Ubuntu20.04.md) or [ROS2 Galactic](./doc/getting_started_with_Galactic_Ubuntu20.04.md) for detailed installation & lauching instructions. +See Getting Start Pages for [ROS2 Dashing](./doc/getting_started_with_Dashing.md) or [ROS2 Foxy](./doc/getting_started_with_Foxy_Ubuntu20.04.md) for detailed installation & lauching instructions. # More Information -* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw +* 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/getting_started_with_Galactic_Ubuntu20.04.md b/doc/getting_started_with_Galactic_Ubuntu20.04.md deleted file mode 100644 index 587eeccb..00000000 --- a/doc/getting_started_with_Galactic_Ubuntu20.04.md +++ /dev/null @@ -1,117 +0,0 @@ -# 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.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_apt.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 -* Build demo code in OpenVINO toolkit -``` - # root is required instead of sudo - source /opt/intel//bin/setupvars.sh - cd /opt/intel//deployment_tools/open_model_zoo/demos - source build_demos.sh -``` -* Install ROS2_OpenVINO packages -``` -mkdir -p ~/my_ros2_ws/src -cd ~/my_ros2_ws/src -git clone https://github.com/intel/ros2_openvino_toolkit -b dev-ov.2021.4 -git clone https://github.com/intel/ros2_object_msgs -git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2 -``` -* Build package -``` -source /opt/ros/galactic/setup.bash -source /opt/intel//bin/setupvars.sh -cd ~/my_ros2_ws/src -colcon build --symlink-install -source ./install/local_setup.bash -``` - -## 3. Running the Demo -* Preparation - * Configure the Neural Compute Stick USB Driver (if needed) -``` - cd ~/Downloads - cat < 97-usbboot.rules - SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" - SUBSYSTEM=="usb", ATTRS{idProduct}=="2485", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" - SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" - EOF - sudo cp 97-usbboot.rules /etc/udev/rules.d/ - sudo udevadm control --reload-rules - sudo udevadm trigger - sudo ldconfig - rm 97-usbboot.rules -``` - -* 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//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 -``` - -* copy label files (execute once) -``` - sudo cp ~/my_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 ~/my_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 ~/my_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 ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/ - sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/ - sudo cp ~/my_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 - sudo cp ~/my_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 ~/my_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/ -``` - -* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection) -``` - sudo python3 downloader.py --name mobilenet-ssd --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output - cd /opt/intel//deployment_tools/model_optimizer - sudo python3 mo.py --input_model /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output/public/mobilenet-ssd/mobilenet-ssd.caffemodel --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output -``` - -* 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 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 -``` -* run person reidentification sample code input from StandardCamera. -``` -ros2 launch dynamic_vino_sample pipeline_reidentification.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/Dockerfile b/docker/Dockerfile deleted file mode 100644 index a37b8408..00000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -# ros2 openvino toolkit env master f1b1ca4d914186a1881b87f103be9c6e910c9d80 - -from osrf/ros:foxy-desktop - -MAINTAINER Cong Liu congliu0913@126.com - -SHELL ["/bin/bash", "-c"] - -# install openvino 2021.3 -# 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.3.394 -RUN ls -lh /opt/intel/openvino_2021 -RUN source /opt/intel/openvino_2021/bin/setupvars.sh - -# install librealsense2 -# https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md -RUN apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE -#RUN add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo focal main" -u -RUN echo 'deb https://librealsense.intel.com/Debian/apt-repo focal main' | sudo tee /etc/apt/sources.list.d/realsense-public.list -RUN apt-get update && apt-get install -y librealsense2-dev librealsense2 -RUN dpkg -l |grep realsense - -# 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 https://github.com/intel/ros2_openvino_toolkit.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 From a13e73b7ba571aad3c4ae50ea24e99eab72baf2d Mon Sep 17 00:00:00 2001 From: Li Pengqiang Date: Fri, 10 Dec 2021 00:38:37 +0800 Subject: [PATCH 5/9] Add quick_start folder --- doc/quick_start/getting_started_with_Dashing_Ubuntu18.04.md | 0 doc/quick_start/getting_started_with_Foxy_Ubuntu20.04.md | 0 doc/quick_start/getting_started_with_Galactic_Ubuntu20.04.md | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/quick_start/getting_started_with_Dashing_Ubuntu18.04.md create mode 100644 doc/quick_start/getting_started_with_Foxy_Ubuntu20.04.md create mode 100644 doc/quick_start/getting_started_with_Galactic_Ubuntu20.04.md 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..e69de29b 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..e69de29b 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..e69de29b From 552f03ee9c4883df9ae1666ef863744c0ecba509 Mon Sep 17 00:00:00 2001 From: Li Pengqiang Date: Fri, 10 Dec 2021 23:39:05 +0800 Subject: [PATCH 6/9] Update the getting_started_with_Galactic_Ubuntu20.04.md --- ...tting_started_with_Galactic_Ubuntu20.04.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/doc/quick_start/getting_started_with_Galactic_Ubuntu20.04.md b/doc/quick_start/getting_started_with_Galactic_Ubuntu20.04.md index e69de29b..244e562d 100644 --- a/doc/quick_start/getting_started_with_Galactic_Ubuntu20.04.md +++ b/doc/quick_start/getting_started_with_Galactic_Ubuntu20.04.md @@ -0,0 +1,121 @@ +# 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 +* 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) +``` + 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) + * mobilenet-ssd + ``` + sudo python3 downloader.py --name mobilenet-ssd --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output + cd /opt/intel/openvino_2021/deployment_tools/model_optimizer + sudo python3 mo.py --input_model /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output/public/mobilenet-ssd/mobilenet-ssd.caffemodel --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output + ``` + * deeplabv3 + ``` + cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader + sudo python3 downloader.py --name deeplabv3 --output_dir /opt/openvino_toolkit/models/deeplabv3/output + sudo python3 converter.py --name=deeplabv3 --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 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* + From 91e0a8fa4989cd6d599cb8de209130da84df8fec Mon Sep 17 00:00:00 2001 From: Li Pengqiang Date: Tue, 14 Dec 2021 20:08:14 +0800 Subject: [PATCH 7/9] Update the launch and param of galactic_dev --- .../pipeline_composite_object_topic.launch.py | 2 +- .../pipeline_face_reidentification.launch.py | 6 +- sample/launch/pipeline_image.launch.py | 6 +- sample/launch/pipeline_object.launch.py | 3 +- sample/launch/pipeline_object_topic.launch.py | 6 +- sample/launch/pipeline_object_yolo.launch.py | 6 +- .../pipeline_object_yolo_topic.launch.py | 6 +- sample/launch/pipeline_people.launch.py | 6 +- sample/launch/pipeline_people_ip.launch.py | 6 +- .../pipeline_person_attributes.launch.py | 6 +- .../pipeline_reidentification.launch.py | 6 +- sample/launch/pipeline_segmentation.launch.py | 8 ++- .../pipeline_segmentation_image.launch.py | 54 ++++++++++++++++++ .../pipeline_vehicle_detection.launch.py | 6 +- sample/launch/pipeline_video.launch.py | 6 +- sample/param/.pipeline_segmentation.yaml.swp | Bin 0 -> 12288 bytes .../pipeline_composite_object_topic.yaml | 4 +- .../param/pipeline_face_reidentification.yaml | 2 +- sample/param/pipeline_image.yaml | 2 +- sample/param/pipeline_object.yaml | 2 +- sample/param/pipeline_object_topic.yaml | 8 +-- sample/param/pipeline_object_yolo.yaml | 4 +- sample/param/pipeline_people.yaml | 4 +- sample/param/pipeline_reidentification.yaml | 2 +- sample/param/pipeline_segmentation.yaml | 4 +- sample/param/pipeline_segmentation_image.yaml | 4 +- sample/param/pipeline_vehicle_detection.yaml | 4 +- sample/param/pipeline_video.yaml | 5 +- 28 files changed, 128 insertions(+), 50 deletions(-) create mode 100644 sample/launch/pipeline_segmentation_image.launch.py create mode 100644 sample/param/.pipeline_segmentation.yaml.swp diff --git a/sample/launch/pipeline_composite_object_topic.launch.py b/sample/launch/pipeline_composite_object_topic.launch.py index 3a572680..5184448f 100644 --- a/sample/launch/pipeline_composite_object_topic.launch.py +++ b/sample/launch/pipeline_composite_object_topic.launch.py @@ -11,7 +11,7 @@ def generate_launch_description(): node_name='vision_pipeline', node_namespace='', package='rclcpp_components', - node_executable='component_container', + executable='component_container', composable_node_descriptions=[ ComposableNode( package='realsense_ros', diff --git a/sample/launch/pipeline_face_reidentification.launch.py b/sample/launch/pipeline_face_reidentification.launch.py index aed6424c..93949305 100644 --- a/sample/launch/pipeline_face_reidentification.launch.py +++ b/sample/launch/pipeline_face_reidentification.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/people/detected_landmarks', @@ -41,6 +42,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_image.launch.py b/sample/launch/pipeline_image.launch.py index 77e0fca0..040b0700 100644 --- a/sample/launch/pipeline_image.launch.py +++ b/sample/launch/pipeline_image.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/people/faces', @@ -45,6 +46,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_object.launch.py b/sample/launch/pipeline_object.launch.py index 96e3ba7f..f30fd3b7 100644 --- a/sample/launch/pipeline_object.launch.py +++ b/sample/launch/pipeline_object.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/object/detected_objects', diff --git a/sample/launch/pipeline_object_topic.launch.py b/sample/launch/pipeline_object_topic.launch.py index a33bde0b..872a3d74 100644 --- a/sample/launch/pipeline_object_topic.launch.py +++ b/sample/launch/pipeline_object_topic.launch.py @@ -36,7 +36,8 @@ def generate_launch_description(): # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/object/detected_objects', @@ -46,6 +47,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_object_yolo.launch.py b/sample/launch/pipeline_object_yolo.launch.py index 7bb4685e..6dc4fa9c 100644 --- a/sample/launch/pipeline_object_yolo.launch.py +++ b/sample/launch/pipeline_object_yolo.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/object/detected_objects', @@ -40,6 +41,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_object_yolo_topic.launch.py b/sample/launch/pipeline_object_yolo_topic.launch.py index 2d00a4bf..2a38ccd8 100644 --- a/sample/launch/pipeline_object_yolo_topic.launch.py +++ b/sample/launch/pipeline_object_yolo_topic.launch.py @@ -36,7 +36,8 @@ def generate_launch_description(): # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), @@ -47,6 +48,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_people.launch.py b/sample/launch/pipeline_people.launch.py index 7cd67360..382fb2a2 100644 --- a/sample/launch/pipeline_people.launch.py +++ b/sample/launch/pipeline_people.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/people/detected_objects', @@ -45,6 +46,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_people_ip.launch.py b/sample/launch/pipeline_people_ip.launch.py index 78b6e1f5..df970d35 100644 --- a/sample/launch/pipeline_people_ip.launch.py +++ b/sample/launch/pipeline_people_ip.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/people/detected_objects', @@ -45,6 +46,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_person_attributes.launch.py b/sample/launch/pipeline_person_attributes.launch.py index a5ef4015..26714c49 100644 --- a/sample/launch/pipeline_person_attributes.launch.py +++ b/sample/launch/pipeline_person_attributes.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/object/detected_objects', @@ -40,6 +41,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_reidentification.launch.py b/sample/launch/pipeline_reidentification.launch.py index 2572729d..9c6ed2ca 100644 --- a/sample/launch/pipeline_reidentification.launch.py +++ b/sample/launch/pipeline_reidentification.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/object/detected_objects', @@ -41,6 +42,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_segmentation.launch.py b/sample/launch/pipeline_segmentation.launch.py index 106978e5..9a2a8dd7 100644 --- a/sample/launch/pipeline_segmentation.launch.py +++ b/sample/launch/pipeline_segmentation.launch.py @@ -23,7 +23,7 @@ def generate_launch_description(): default_yaml = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'param', - 'pipeline_segmentation_image.yaml') + 'pipeline_segmentation.yaml') default_rviz = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'launch', 'rviz/default.rviz') return LaunchDescription([ @@ -36,7 +36,8 @@ def generate_launch_description(): # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), @@ -47,6 +48,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_segmentation_image.launch.py b/sample/launch/pipeline_segmentation_image.launch.py new file mode 100644 index 00000000..dd99f503 --- /dev/null +++ b/sample/launch/pipeline_segmentation_image.launch.py @@ -0,0 +1,54 @@ +# Copyright 2018 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Launch face detection and rviz.""" + +import os + +from ament_index_python.packages import get_package_share_directory +from launch import LaunchDescription +import launch_ros.actions + + +def generate_launch_description(): + default_yaml = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'param', + 'pipeline_segmentation_image.yaml') + default_rviz = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'launch', + 'rviz/default.rviz') + return LaunchDescription([ + # Realsense + # NOTE: Split realsense_node launching from OpenVINO package, which + # will be launched by RDK launching file or manually. + #launch_ros.actions.Node( + # package='realsense_ros2_camera', node_executable='realsense_ros2_camera', + # output='screen'), + + # Openvino detection + launch_ros.actions.Node( + package='dynamic_vino_sample', + executable='pipeline_with_params', + arguments=['-config', default_yaml], + remappings=[ + ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), + ('/openvino_toolkit/segmentation/segmented_obejcts', + '/ros2_openvino_toolkit/segmented_obejcts'), + ('/openvino_toolkit/segmentation/images', '/ros2_openvino_toolkit/image_rviz')], + output='screen'), + + # Rviz + launch_ros.actions.Node( + package='rviz2', + executable='rviz2', output='screen', + arguments=['--display-config', default_rviz]), + ]) diff --git a/sample/launch/pipeline_vehicle_detection.launch.py b/sample/launch/pipeline_vehicle_detection.launch.py index 050bbf86..bca7634a 100644 --- a/sample/launch/pipeline_vehicle_detection.launch.py +++ b/sample/launch/pipeline_vehicle_detection.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/object/detected_license_plates', @@ -41,6 +42,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_video.launch.py b/sample/launch/pipeline_video.launch.py index e0a15d7a..7628ef61 100644 --- a/sample/launch/pipeline_video.launch.py +++ b/sample/launch/pipeline_video.launch.py @@ -29,7 +29,8 @@ def generate_launch_description(): return LaunchDescription([ # Openvino detection launch_ros.actions.Node( - package='dynamic_vino_sample', node_executable='pipeline_with_params', + package='dynamic_vino_sample', + executable='pipeline_with_params', arguments=['-config', default_yaml], remappings=[ ('/openvino_toolkit/segmentation/segmented_obejcts', @@ -39,6 +40,7 @@ def generate_launch_description(): # Rviz launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', + package='rviz2', + executable='rviz2', output='screen', arguments=['--display-config', default_rviz]), ]) diff --git a/sample/param/.pipeline_segmentation.yaml.swp b/sample/param/.pipeline_segmentation.yaml.swp new file mode 100644 index 0000000000000000000000000000000000000000..d3819bf95e9165c60cb94398cf6db970540bcf9d GIT binary patch literal 12288 zcmeI2F>ezw6vtg81WN#c#E48_Y;s8uQg!NrLIoMBRB2NLQHgvPCvoeuPiJ2e7+~QW zptABI5MtzOFf#A~U|{FP=TxDEijJu7DgX1kXZxMs@020Ri)y>AO}bXC6R>N99NzlC zo?RZ3_vRAGqg>g%QJYVlX8*eG)nZ|=FW8ieAk(IzC-b4vA2G>dE8@ORxta*2`%@E` zEG}k`f>vvJAZ%b*l1d(=EMrNKij+&Cc;E0*!j)xKXjOf|5_#IOaSjQb9|E}@R@O@0 zdyTsLKHn+drZ=v4&rkhWDH1>eNB{{S0VIF~kN^@u0>q{($xH`AEoCvs8MK^U*Cy7=eA=FtWMq?Y&UT0Ul+;g!Cm3#=H zcC^o9yS>y%eSC{HJ31Bd8Mn0(HsVi&8tCa6cb+`a?+H4b$!)F-Z?c4E%pDHS9BZYZ z5)*>2bDQSi(%#ZBR%yqV0^Sh^w{a*2T*bU^#~C+cEe9d3RquNc5wr0)q;-EQS;S>X ztqvj{7;b~vY*uwa<5zGsg68y)mLG5IY;@XTbE~`h2({lgvFwaw+LDxD3 jt55~?{N;rRHRPEqO( Date: Mon, 27 Dec 2021 22:56:42 +0800 Subject: [PATCH 8/9] Update the launch for yaml_path --- .../pipeline_people.launch.cpython-38.pyc | Bin 0 -> 1298 bytes .../pipeline_face_reidentification.launch.py | 11 ++++++++--- sample/launch/pipeline_image.launch.py | 11 ++++++++--- sample/launch/pipeline_object.launch.py | 11 ++++++++--- sample/launch/pipeline_object_topic.launch.py | 11 ++++++++--- sample/launch/pipeline_object_yolo.launch.py | 11 ++++++++--- .../launch/pipeline_object_yolo_topic.launch.py | 11 ++++++++--- sample/launch/pipeline_people.launch.py | 13 ++++++++++--- sample/launch/pipeline_people_ip.launch.py | 11 ++++++++--- .../launch/pipeline_person_attributes.launch.py | 11 ++++++++--- .../launch/pipeline_reidentification.launch.py | 11 ++++++++--- sample/launch/pipeline_segmentation.launch.py | 11 ++++++++--- .../launch/pipeline_segmentation_image.launch.py | 11 ++++++++--- .../launch/pipeline_vehicle_detection.launch.py | 11 ++++++++--- sample/launch/pipeline_video.launch.py | 11 ++++++++--- 15 files changed, 114 insertions(+), 42 deletions(-) create mode 100644 sample/launch/__pycache__/pipeline_people.launch.cpython-38.pyc diff --git a/sample/launch/__pycache__/pipeline_people.launch.cpython-38.pyc b/sample/launch/__pycache__/pipeline_people.launch.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8848b7fbc32b86225ef1f6a330bb93e549db18af GIT binary patch literal 1298 zcmZ`&KW`H;6hHg^C25*AEd!`SQv|~aHIXU?2857cL>)jZw^;7kxj5XNPqtHe}AH%8;K>>p=A95SB;Z=JZo@CzpjtKDaGQY53^ zkS4sxxZ#Nrvgpx*_0+Mb`df-8s%vt`j9n zi;>vKi)GWb1wDbShaikIM(?n389IZ+nfu;-bKT}KA8g2Y#vcdc5K0M7ofNTA=dnrCcP+<2k-e%K+<{}}-qL4(>yv%s*msHWbx>1Uf zXQJSw73yTM4Ay%J_H zM}%XD_!+hH7>YFVR0srC@G2c;Ijx!?qDGCSuDz0)QSFVTD3s;AazWIsIiUy)z7FZ^g@Nm# zWIV!gdqFT_xwq8p?H?S~h4`Ph{-x<0uU}5>vn;rxhLgn|Z21CjLae?I!a*H`|9E&V zF%A$$*!A$``hi>cySF{FI~WDOyl-k7;-Y3962fFch*|?Z-l4W(M8H^2NI5klS@ajZ y)$@XVaGO;fZ!N3tFN#(jduowqg Date: Thu, 30 Dec 2021 22:11:10 +0800 Subject: [PATCH 9/9] Update for label_path --- .../models/age_gender_detection_model.hpp | 2 +- .../dynamic_vino_lib/models/base_model.hpp | 5 +++-- .../models/emotion_detection_model.hpp | 2 +- .../models/face_detection_model.hpp | 2 +- .../models/face_reidentification_model.hpp | 2 +- .../models/head_pose_detection_model.hpp | 2 +- .../models/landmarks_detection_model.hpp | 2 +- .../models/license_plate_detection_model.hpp | 2 +- .../models/object_detection_ssd_model.hpp | 2 +- .../models/object_detection_yolov2_model.hpp | 2 +- .../models/object_segmentation_model.hpp | 2 +- .../models/person_attribs_detection_model.hpp | 2 +- .../models/person_reidentification_model.hpp | 2 +- .../vehicle_attribs_detection_model.hpp | 2 +- .../src/models/age_gender_detection_model.cpp | 3 ++- dynamic_vino_lib/src/models/base_model.cpp | 18 ++++++++++------- .../src/models/emotion_detection_model.cpp | 4 ++-- .../src/models/face_detection_model.cpp | 4 ++-- .../models/face_reidentification_model.cpp | 4 ++-- .../src/models/head_pose_detection_model.cpp | 4 ++-- .../src/models/landmarks_detection_model.cpp | 4 ++-- .../models/license_plate_detection_model.cpp | 4 ++-- .../src/models/object_detection_ssd_model.cpp | 4 ++-- .../models/object_detection_yolov2_model.cpp | 4 ++-- .../src/models/object_segmentation_model.cpp | 5 +++-- .../models/person_attribs_detection_model.cpp | 4 ++-- .../models/person_reidentification_model.cpp | 4 ++-- .../vehicle_attribs_detection_model.cpp | 4 ++-- dynamic_vino_lib/src/pipeline_manager.cpp | 20 +++++++++---------- 29 files changed, 64 insertions(+), 57 deletions(-) diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/age_gender_detection_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/age_gender_detection_model.hpp index 1a5d5016..7ef53bfd 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/age_gender_detection_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/age_gender_detection_model.hpp @@ -32,7 +32,7 @@ namespace Models class AgeGenderDetectionModel : public BaseModel { public: - AgeGenderDetectionModel(const std::string & model_loc, int batch_size = 1); + AgeGenderDetectionModel(const std::string& label_loc, const std::string& model_loc, int batch_size = 1); /** * @brief Get the input name. * @return Input name. diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/base_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/base_model.hpp index f3379670..b3e19a52 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/base_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/base_model.hpp @@ -63,7 +63,7 @@ namespace Models * @param[in] batch_size The number of batch size (default: 1) the network should have. * @return Whether the input device is successfully turned on. */ - BaseModel(const std::string &model_loc, int batch_size = 1); + BaseModel(const std::string& label_loc, const std::string& model_loc, int batch_size = 1); /** * @brief Get the maximum batch size of the model. @@ -124,13 +124,14 @@ namespace Models private: int max_batch_size_; std::string model_loc_; + std::string label_loc_; cv::Size frame_size_; }; class ObjectDetectionModel : public BaseModel { public: - ObjectDetectionModel(const std::string &model_loc, int batch_size = 1); + ObjectDetectionModel(const std::string& label_loc, const std::string& model_loc, int batch_size = 1); virtual bool fetchResults( const std::shared_ptr &engine, std::vector &result, diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/emotion_detection_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/emotion_detection_model.hpp index edf9682c..de5d4dfb 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/emotion_detection_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/emotion_detection_model.hpp @@ -32,7 +32,7 @@ namespace Models class EmotionDetectionModel : public BaseModel { public: - EmotionDetectionModel(const std::string & model_loc, int batch_size = 1); + EmotionDetectionModel(const std::string& label_loc, const std::string& model_loc, int batch_size = 1); /** * @brief Get the name of this detection model. diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/face_detection_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/face_detection_model.hpp index f7c83ac6..11c7efae 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/face_detection_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/face_detection_model.hpp @@ -32,7 +32,7 @@ namespace Models class FaceDetectionModel : public ObjectDetectionModel { public: - FaceDetectionModel(const std::string & model_loc, int batch_size = 1); + FaceDetectionModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); //void checkLayerProperty(const InferenceEngine::CNNNetReader::Ptr &) override; /** * @brief Get the name of this detection model. diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/face_reidentification_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/face_reidentification_model.hpp index 20d88f2b..1939cf05 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/face_reidentification_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/face_reidentification_model.hpp @@ -29,7 +29,7 @@ namespace Models class FaceReidentificationModel : public BaseModel { public: - FaceReidentificationModel(const std::string & model_loc, int batch_size = 1); + FaceReidentificationModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); inline const std::string getInputName() {return input_;} inline const std::string getOutputName() {return output_;} /** diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/head_pose_detection_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/head_pose_detection_model.hpp index 1b0bc1b1..5afce9b3 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/head_pose_detection_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/head_pose_detection_model.hpp @@ -32,7 +32,7 @@ namespace Models class HeadPoseDetectionModel : public BaseModel { public: - HeadPoseDetectionModel(const std::string & model_loc, int batch_size = 1); + HeadPoseDetectionModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); /** * @brief Get the output angle roll. diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/landmarks_detection_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/landmarks_detection_model.hpp index a1434850..7bbb51e5 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/landmarks_detection_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/landmarks_detection_model.hpp @@ -29,7 +29,7 @@ namespace Models class LandmarksDetectionModel : public BaseModel { public: - LandmarksDetectionModel(const std::string & model_loc, int batch_size = 1); + LandmarksDetectionModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); inline const std::string getInputName() {return input_;} inline const std::string getOutputName() {return output_;} /** diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/license_plate_detection_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/license_plate_detection_model.hpp index 0074f764..9357160a 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/license_plate_detection_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/license_plate_detection_model.hpp @@ -29,7 +29,7 @@ namespace Models class LicensePlateDetectionModel : public BaseModel { public: - LicensePlateDetectionModel(const std::string & model_loc, int batch_size = 1); + LicensePlateDetectionModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); inline const std::string getInputName() {return input_;} inline const std::string getSeqInputName() {return seq_input_;} inline const std::string getOutputName() {return output_;} diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/object_detection_ssd_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/object_detection_ssd_model.hpp index cca96f77..76bb6354 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/object_detection_ssd_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/object_detection_ssd_model.hpp @@ -32,7 +32,7 @@ class ObjectDetectionSSDModel : public ObjectDetectionModel using Result = dynamic_vino_lib::ObjectDetectionResult; public: - ObjectDetectionSSDModel(const std::string & model_loc, int batch_size = 1); + ObjectDetectionSSDModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); bool fetchResults( const std::shared_ptr & engine, diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/object_detection_yolov2_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/object_detection_yolov2_model.hpp index 25f2b982..efbe17e9 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/object_detection_yolov2_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/object_detection_yolov2_model.hpp @@ -32,7 +32,7 @@ class ObjectDetectionYolov2Model : public ObjectDetectionModel using Result = dynamic_vino_lib::ObjectDetectionResult; public: - ObjectDetectionYolov2Model(const std::string & model_loc, int batch_size = 1); + ObjectDetectionYolov2Model(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); bool fetchResults( const std::shared_ptr & engine, diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/object_segmentation_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/object_segmentation_model.hpp index c17bba8f..af047bcc 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/object_segmentation_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/object_segmentation_model.hpp @@ -28,7 +28,7 @@ namespace Models class ObjectSegmentationModel : public BaseModel { public: - ObjectSegmentationModel(const std::string & model_loc, int batch_size = 1); + ObjectSegmentationModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); inline int getMaxProposalCount() const { return max_proposal_count_; diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/person_attribs_detection_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/person_attribs_detection_model.hpp index 0389f2cf..d05e67a6 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/person_attribs_detection_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/person_attribs_detection_model.hpp @@ -29,7 +29,7 @@ namespace Models class PersonAttribsDetectionModel : public BaseModel { public: - PersonAttribsDetectionModel(const std::string & model_loc, int batch_size = 1); + PersonAttribsDetectionModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); //inline const std::string getInputName() {return input_;} //inline const std::string getOutputName() {return output_;} /** diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/person_reidentification_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/person_reidentification_model.hpp index 57be91ba..41ff85c7 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/person_reidentification_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/person_reidentification_model.hpp @@ -29,7 +29,7 @@ namespace Models class PersonReidentificationModel : public BaseModel { public: - PersonReidentificationModel(const std::string & model_loc, int batch_size = 1); + PersonReidentificationModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); inline const std::string getInputName() {return input_;} inline const std::string getOutputName() {return output_;} /** diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/models/vehicle_attribs_detection_model.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/models/vehicle_attribs_detection_model.hpp index 38b452f6..9ed5acdc 100644 --- a/dynamic_vino_lib/include/dynamic_vino_lib/models/vehicle_attribs_detection_model.hpp +++ b/dynamic_vino_lib/include/dynamic_vino_lib/models/vehicle_attribs_detection_model.hpp @@ -29,7 +29,7 @@ namespace Models class VehicleAttribsDetectionModel : public BaseModel { public: - VehicleAttribsDetectionModel(const std::string & model_loc, int batch_size = 1); + VehicleAttribsDetectionModel(const std::string& label_loc, const std::string & model_loc, int batch_size = 1); inline const std::string getInputName() {return input_;} inline const std::string getColorOutputName() {return color_output_;} inline const std::string getTypeOutputName() {return type_output_;} diff --git a/dynamic_vino_lib/src/models/age_gender_detection_model.cpp b/dynamic_vino_lib/src/models/age_gender_detection_model.cpp index 480f6a06..fa7e6f2d 100644 --- a/dynamic_vino_lib/src/models/age_gender_detection_model.cpp +++ b/dynamic_vino_lib/src/models/age_gender_detection_model.cpp @@ -24,9 +24,10 @@ // Validated Age Gender Classification Network Models::AgeGenderDetectionModel::AgeGenderDetectionModel( + const std::string & label_loc, const std::string & model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) +: BaseModel(label_loc,model_loc, max_batch_size) { } bool Models::AgeGenderDetectionModel::updateLayerProperty( diff --git a/dynamic_vino_lib/src/models/base_model.cpp b/dynamic_vino_lib/src/models/base_model.cpp index 2402fb1f..f9ddeaa6 100644 --- a/dynamic_vino_lib/src/models/base_model.cpp +++ b/dynamic_vino_lib/src/models/base_model.cpp @@ -29,8 +29,9 @@ // Validated Base Network Models::BaseModel::BaseModel( - const std::string & model_loc, int max_batch_size) -: model_loc_(model_loc), + const std::string& label_loc, const std::string& model_loc, int max_batch_size) +: label_loc_(label_loc), + model_loc_(model_loc), max_batch_size_(max_batch_size), ModelAttribute(model_loc) { @@ -43,7 +44,8 @@ Models::BaseModel::BaseModel( void Models::BaseModel::modelInit() { - slog::info << "Loading network files" << slog::endl; + slog::info << "Loading network files" << model_loc_ << slog::endl; + slog::info << label_loc_ << slog::endl; // Read network model ///net_reader_->ReadNetwork(model_loc_); net_reader_ = engine.ReadNetwork(model_loc_); @@ -54,8 +56,9 @@ void Models::BaseModel::modelInit() ///std::string bin_file_name = raw_name + ".bin"; ///net_reader_->ReadWeights(bin_file_name); // Read labels (if any) - std::string label_file_name = raw_name + ".labels"; - loadLabelsFromFile(label_file_name); + std::string label_file_name = label_loc_.substr(0, last_index); + //std::string label_file_name = raw_name + ".labels"; + loadLabelsFromFile(label_loc_); // Set batch size to given max_batch_size_ slog::info << "Batch size is set to " << max_batch_size_ << slog::endl; @@ -87,6 +90,7 @@ bool Models::BaseModel::updateLayerProperty( #endif Models::ObjectDetectionModel::ObjectDetectionModel( - const std::string & model_loc, + const std::string& label_loc, + const std::string& model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) {} +: BaseModel(label_loc, model_loc, max_batch_size) {} diff --git a/dynamic_vino_lib/src/models/emotion_detection_model.cpp b/dynamic_vino_lib/src/models/emotion_detection_model.cpp index ef43ea1f..0c4f78e0 100644 --- a/dynamic_vino_lib/src/models/emotion_detection_model.cpp +++ b/dynamic_vino_lib/src/models/emotion_detection_model.cpp @@ -23,8 +23,8 @@ // Validated Emotions Detection Network Models::EmotionDetectionModel::EmotionDetectionModel( - const std::string & model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: BaseModel(label_loc, model_loc, max_batch_size) { } diff --git a/dynamic_vino_lib/src/models/face_detection_model.cpp b/dynamic_vino_lib/src/models/face_detection_model.cpp index 754491a8..c673b6d7 100644 --- a/dynamic_vino_lib/src/models/face_detection_model.cpp +++ b/dynamic_vino_lib/src/models/face_detection_model.cpp @@ -24,8 +24,8 @@ // Validated Face Detection Network Models::FaceDetectionModel::FaceDetectionModel( - const std::string & model_loc, int max_batch_size) -: ObjectDetectionModel(model_loc, max_batch_size) + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: ObjectDetectionModel(label_loc, model_loc, max_batch_size) { } diff --git a/dynamic_vino_lib/src/models/face_reidentification_model.cpp b/dynamic_vino_lib/src/models/face_reidentification_model.cpp index 94eafa54..a5d4572c 100644 --- a/dynamic_vino_lib/src/models/face_reidentification_model.cpp +++ b/dynamic_vino_lib/src/models/face_reidentification_model.cpp @@ -21,8 +21,8 @@ #include "dynamic_vino_lib/slog.hpp" // Validated Face Reidentification Network Models::FaceReidentificationModel::FaceReidentificationModel( - const std::string & model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) {} + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: BaseModel(label_loc, model_loc, max_batch_size) {} void Models::FaceReidentificationModel::setLayerProperty( InferenceEngine::CNNNetwork& net_reader) diff --git a/dynamic_vino_lib/src/models/head_pose_detection_model.cpp b/dynamic_vino_lib/src/models/head_pose_detection_model.cpp index 8dad21a2..faaa6dcf 100644 --- a/dynamic_vino_lib/src/models/head_pose_detection_model.cpp +++ b/dynamic_vino_lib/src/models/head_pose_detection_model.cpp @@ -25,8 +25,8 @@ // Validated Head Pose Network Models::HeadPoseDetectionModel::HeadPoseDetectionModel( - const std::string & model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: BaseModel(label_loc, model_loc, max_batch_size) { } diff --git a/dynamic_vino_lib/src/models/landmarks_detection_model.cpp b/dynamic_vino_lib/src/models/landmarks_detection_model.cpp index 148559c2..42aa5319 100644 --- a/dynamic_vino_lib/src/models/landmarks_detection_model.cpp +++ b/dynamic_vino_lib/src/models/landmarks_detection_model.cpp @@ -21,8 +21,8 @@ #include "dynamic_vino_lib/slog.hpp" // Validated Landmarks Detection Network Models::LandmarksDetectionModel::LandmarksDetectionModel( - const std::string & model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) {} + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: BaseModel(label_loc, model_loc, max_batch_size) {} void Models::LandmarksDetectionModel::setLayerProperty( InferenceEngine::CNNNetwork& net_reader) diff --git a/dynamic_vino_lib/src/models/license_plate_detection_model.cpp b/dynamic_vino_lib/src/models/license_plate_detection_model.cpp index 896d35f3..171764f5 100644 --- a/dynamic_vino_lib/src/models/license_plate_detection_model.cpp +++ b/dynamic_vino_lib/src/models/license_plate_detection_model.cpp @@ -21,8 +21,8 @@ #include "dynamic_vino_lib/slog.hpp" // Validated Vehicle Attributes Detection Network Models::LicensePlateDetectionModel::LicensePlateDetectionModel( - const std::string & model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) {} + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: BaseModel(label_loc, model_loc, max_batch_size) {} bool Models::LicensePlateDetectionModel::updateLayerProperty( InferenceEngine::CNNNetwork& net_reader) diff --git a/dynamic_vino_lib/src/models/object_detection_ssd_model.cpp b/dynamic_vino_lib/src/models/object_detection_ssd_model.cpp index 949deeba..d0996fdc 100644 --- a/dynamic_vino_lib/src/models/object_detection_ssd_model.cpp +++ b/dynamic_vino_lib/src/models/object_detection_ssd_model.cpp @@ -27,8 +27,8 @@ // Validated Object Detection Network Models::ObjectDetectionSSDModel::ObjectDetectionSSDModel( - const std::string & model_loc, int max_batch_size) -: ObjectDetectionModel(model_loc, max_batch_size) + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: ObjectDetectionModel(label_loc, model_loc, max_batch_size) { slog::debug << "TESTING: in ObjectDetectionSSDModel" << slog::endl; //addCandidatedAttr(std::make_shared()); diff --git a/dynamic_vino_lib/src/models/object_detection_yolov2_model.cpp b/dynamic_vino_lib/src/models/object_detection_yolov2_model.cpp index 1c86020e..df1388ab 100644 --- a/dynamic_vino_lib/src/models/object_detection_yolov2_model.cpp +++ b/dynamic_vino_lib/src/models/object_detection_yolov2_model.cpp @@ -28,8 +28,8 @@ // Validated Object Detection Network Models::ObjectDetectionYolov2Model::ObjectDetectionYolov2Model( - const std::string & model_loc, int max_batch_size) -: ObjectDetectionModel(model_loc, max_batch_size) + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: ObjectDetectionModel(label_loc, model_loc, max_batch_size) { } diff --git a/dynamic_vino_lib/src/models/object_segmentation_model.cpp b/dynamic_vino_lib/src/models/object_segmentation_model.cpp index c64baffa..ab4797f0 100644 --- a/dynamic_vino_lib/src/models/object_segmentation_model.cpp +++ b/dynamic_vino_lib/src/models/object_segmentation_model.cpp @@ -24,9 +24,10 @@ #include "dynamic_vino_lib/engines/engine.hpp" // Validated Object Segmentation Network Models::ObjectSegmentationModel::ObjectSegmentationModel( - const std::string &model_loc, + const std::string & label_loc, + const std::string & model_loc, int max_batch_size) - : BaseModel(model_loc, max_batch_size) + : BaseModel(label_loc, model_loc, max_batch_size) { } diff --git a/dynamic_vino_lib/src/models/person_attribs_detection_model.cpp b/dynamic_vino_lib/src/models/person_attribs_detection_model.cpp index 355b2857..c12e4071 100644 --- a/dynamic_vino_lib/src/models/person_attribs_detection_model.cpp +++ b/dynamic_vino_lib/src/models/person_attribs_detection_model.cpp @@ -21,8 +21,8 @@ #include "dynamic_vino_lib/slog.hpp" // Validated Person Attributes Detection Network Models::PersonAttribsDetectionModel::PersonAttribsDetectionModel( - const std::string & model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) {} + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: BaseModel(label_loc, model_loc, max_batch_size) {} bool Models::PersonAttribsDetectionModel::updateLayerProperty( InferenceEngine::CNNNetwork& net_reader) diff --git a/dynamic_vino_lib/src/models/person_reidentification_model.cpp b/dynamic_vino_lib/src/models/person_reidentification_model.cpp index 7ae2410e..e9e2834c 100644 --- a/dynamic_vino_lib/src/models/person_reidentification_model.cpp +++ b/dynamic_vino_lib/src/models/person_reidentification_model.cpp @@ -21,8 +21,8 @@ #include "dynamic_vino_lib/slog.hpp" // Validated Person Reidentification Network Models::PersonReidentificationModel::PersonReidentificationModel( - const std::string & model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) {} + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: BaseModel(label_loc, model_loc, max_batch_size) {} /* void Models::PersonReidentificationModel::setLayerProperty( InferenceEngine::CNNNetReader::Ptr net_reader) diff --git a/dynamic_vino_lib/src/models/vehicle_attribs_detection_model.cpp b/dynamic_vino_lib/src/models/vehicle_attribs_detection_model.cpp index 1cdf68b8..0637f3f6 100644 --- a/dynamic_vino_lib/src/models/vehicle_attribs_detection_model.cpp +++ b/dynamic_vino_lib/src/models/vehicle_attribs_detection_model.cpp @@ -21,8 +21,8 @@ #include "dynamic_vino_lib/slog.hpp" // Validated Vehicle Attributes Detection Network Models::VehicleAttribsDetectionModel::VehicleAttribsDetectionModel( - const std::string & model_loc, int max_batch_size) -: BaseModel(model_loc, max_batch_size) {} + const std::string & label_loc, const std::string & model_loc, int max_batch_size) +: BaseModel(label_loc, model_loc, max_batch_size) {} bool Models::VehicleAttribsDetectionModel::updateLayerProperty( InferenceEngine::CNNNetwork& net_reader) diff --git a/dynamic_vino_lib/src/pipeline_manager.cpp b/dynamic_vino_lib/src/pipeline_manager.cpp index 526a0020..5d348255 100644 --- a/dynamic_vino_lib/src/pipeline_manager.cpp +++ b/dynamic_vino_lib/src/pipeline_manager.cpp @@ -248,7 +248,7 @@ PipelineManager::createFaceDetection( std::shared_ptr PipelineManager::createAgeGenderRecognition(const Params::ParamManager::InferenceRawData & param) { - auto model = std::make_shared(param.model, param.batch); + auto model = std::make_shared(param.label, param.model, param.batch); model->modelInit(); auto engine = engine_manager_.createEngine(param.engine, model); auto infer = std::make_shared(); @@ -261,7 +261,7 @@ PipelineManager::createAgeGenderRecognition(const Params::ParamManager::Inferenc std::shared_ptr PipelineManager::createEmotionRecognition(const Params::ParamManager::InferenceRawData & param) { - auto model = std::make_shared(param.model, param.batch); + auto model = std::make_shared(param.label, param.model, param.batch); model->modelInit(); auto engine = engine_manager_.createEngine(param.engine, model); auto infer = std::make_shared(); @@ -274,7 +274,7 @@ PipelineManager::createEmotionRecognition(const Params::ParamManager::InferenceR std::shared_ptr PipelineManager::createHeadPoseEstimation(const Params::ParamManager::InferenceRawData & param) { - auto model = std::make_shared(param.model, param.batch); + auto model = std::make_shared(param.label, param.model, param.batch); model->modelInit(); auto engine = engine_manager_.createEngine(param.engine, model); auto infer = std::make_shared(); @@ -294,11 +294,11 @@ PipelineManager::createObjectDetection( slog::debug << "for test in createObjectDetection()" << slog::endl; if (infer.model_type == kInferTpye_ObjectDetectionTypeSSD) { object_detection_model = - std::make_shared(infer.model, infer.batch); + std::make_shared(infer.label, infer.model, infer.batch); } if (infer.model_type == kInferTpye_ObjectDetectionTypeYolov2) { object_detection_model = - std::make_shared(infer.model, infer.batch); + std::make_shared(infer.label, infer.model, infer.batch); } slog::debug << "for test in createObjectDetection(), Created SSDModel" << slog::endl; @@ -319,7 +319,7 @@ std::shared_ptr PipelineManager::createObjectSegmentation(const Params::ParamManager::InferenceRawData & infer) { auto model = - std::make_shared(infer.model, infer.batch); + std::make_shared(infer.label, infer.model, infer.batch); model->modelInit(); slog::info << "Segmentation model initialized." << slog::endl; auto engine = engine_manager_.createEngine(infer.engine, model); @@ -341,7 +341,7 @@ PipelineManager::createPersonReidentification( std::shared_ptr reidentification_inference_ptr; slog::debug << "for test in createPersonReidentification()"<(infer.model, infer.batch); + std::make_shared(infer.label, infer.model, infer.batch); person_reidentification_model->modelInit(); slog::info << "Reidentification model initialized" << slog::endl; auto person_reidentification_engine = engine_manager_.createEngine(infer.engine, person_reidentification_model); @@ -360,7 +360,7 @@ PipelineManager::createVehicleAttribsDetection( const Params::ParamManager::InferenceRawData & infer) { auto model = - std::make_shared(infer.model, infer.batch); + std::make_shared(infer.label, infer.model, infer.batch); model->modelInit(); auto engine = engine_manager_.createEngine(infer.engine, model); auto vehicle_attribs_ptr = @@ -376,7 +376,7 @@ PipelineManager::createLicensePlateDetection( const Params::ParamManager::InferenceRawData & infer) { auto model = - std::make_shared(infer.model, infer.batch); + std::make_shared(infer.label, infer.model, infer.batch); model->modelInit(); auto engine = engine_manager_.createEngine(infer.engine, model); auto license_plate_ptr = @@ -392,7 +392,7 @@ PipelineManager::createPersonAttribsDetection( const Params::ParamManager::InferenceRawData & infer) { auto model = - std::make_shared(infer.model, infer.batch); + std::make_shared(infer.label, infer.model, infer.batch); slog::debug << "for test in createPersonAttributesDetection()"<modelInit(); auto engine = engine_manager_.createEngine(infer.engine, model);