diff --git a/README.md b/README.md
index a1accd4c..a8e5bc9c 100644
--- a/README.md
+++ b/README.md
@@ -183,7 +183,7 @@ One-step installation scripts are provided for the dependencies' installation. P
* run object detection service sample code input from Image
Run image processing service:
```bash
- ros2 run dynamic_vino_sample image_object_server "image_object_server_oss.yaml"
+ ros2 launch dynamic_vino_sample image_object_server_oss.launch.py
```
Run example application with an absolute path of an image on another console:
```bash
@@ -197,3 +197,4 @@ One-step installation scripts are provided for the dependencies' installation. P
# More Information
* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw
+
diff --git a/data/images/car_vihecle.png b/data/images/car_vihecle.png
new file mode 100644
index 00000000..2b2aa223
Binary files /dev/null and b/data/images/car_vihecle.png differ
diff --git a/doc/BINARY_VERSION_README.md b/doc/BINARY_VERSION_README.md
index 4ce6deba..3df484b4 100644
--- a/doc/BINARY_VERSION_README.md
+++ b/doc/BINARY_VERSION_README.md
@@ -129,24 +129,30 @@ This project is a ROS2 wrapper for CV API of [OpenVINO™](https://software.inte
## 5. Running the Demo
* Preparation
* download and convert a trained model to produce an optimized Intermediate Representation (IR) of the model
- ```bash
- cd /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/install_prerequisites
- sudo ./install_prerequisites.sh
- mkdir -p ~/Downloads/models
- cd ~/Downloads/models
- wget http://download.tensorflow.org/models/object_detection/mask_rcnn_inception_v2_coco_2018_01_28.tar.gz
- tar -zxvf mask_rcnn_inception_v2_coco_2018_01_28.tar.gz
- cd mask_rcnn_inception_v2_coco_2018_01_28
- python3 /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/mo_tf.py --input_model frozen_inference_graph.pb --tensorflow_use_custom_operations_config /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/extensions/front/tf/mask_rcnn_support.json --tensorflow_object_detection_api_pipeline_config pipeline.config --reverse_input_channels --output_dir ./output/
- sudo mkdir -p /opt/models
- sudo ln -sf ~/Downloads/models/mask_rcnn_inception_v2_coco_2018_01_28 /opt/models/
- ```
+ ```bash
+ #object segmentation model
+ cd /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/install_prerequisites
+ sudo ./install_prerequisites.sh
+ mkdir -p ~/Downloads/models
+ cd ~/Downloads/models
+ wget http://download.tensorflow.org/models/object_detection/mask_rcnn_inception_v2_coco_2018_01_28.tar.gz
+ tar -zxvf mask_rcnn_inception_v2_coco_2018_01_28.tar.gz
+ cd mask_rcnn_inception_v2_coco_2018_01_28
+ python3 /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/mo_tf.py --input_model frozen_inference_graph.pb --tensorflow_use_custom_operations_config /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/extensions/front/tf/mask_rcnn_support.json --tensorflow_object_detection_api_pipeline_config pipeline.config --reverse_input_channels --output_dir ./output/
+ sudo mkdir -p /opt/models
+ sudo ln -sf ~/Downloads/models/mask_rcnn_inception_v2_coco_2018_01_28 /opt/models/
+ #object detection model
+ cd /opt/intel/computer_vision_sdk/deployment_tools/model_downloader
+ sudo python3 downloader.py --name ssd300
+ sudo python3 /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/mo.py --input_model /opt/intel/computer_vision_sdk/deployment_tools/model_downloader/object_detection/common/ssd/300/caffe/ssd300.caffemodel --output_dir /opt/intel/computer_vision_sdk/deployment_tools/model_downloader/object_detection/common/ssd/300/caffe/output/
+ ```
* copy label files (excute _once_)
```bash
sudo cp /opt/openvino_toolkit/ros2_openvino_toolkit/data/labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels /opt/intel/computer_vision_sdk/deployment_tools/intel_models/emotions-recognition-retail-0003/FP32
sudo cp /opt/openvino_toolkit/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/intel/computer_vision_sdk/deployment_tools/intel_models/face-detection-adas-0001/FP32
sudo cp /opt/openvino_toolkit/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/intel/computer_vision_sdk/deployment_tools/intel_models/face-detection-adas-0001/FP16
sudo cp /opt/openvino_toolkit/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels ~/Downloads/models/mask_rcnn_inception_v2_coco_2018_01_28/output
+ sudo cp /opt/openvino_toolkit/ros2_openvino_toolkit/data/labels/object_detection/ssd300.labels /opt/intel/computer_vision_sdk/deployment_tools/model_downloader/object_detection/common/ssd/300/caffe/output
```
* set ENV LD_LIBRARY_PATH
```bash
@@ -164,10 +170,6 @@ This project is a ROS2 wrapper for CV API of [OpenVINO™](https://software.inte
```bash
ros2 launch dynamic_vino_sample pipeline_object.launch.py
```
-* run object detection sample code input from RealSenseCameraTopic.
- ```bash
- ros2 launch dynamic_vino_sample pipeline_object_topic.launch.py
- ```
* run object segmentation sample code input from RealSenseCameraTopic.
```bash
ros2 launch dynamic_vino_sample pipeline_segmentation.launch.py
@@ -179,7 +181,7 @@ This project is a ROS2 wrapper for CV API of [OpenVINO™](https://software.inte
* run object detection service sample code input from Image
Run image processing service:
```bash
- ros2 run dynamic_vino_sample image_object_server "image_object_server.yaml"
+ ros2 launch dynamic_vino_sample image_object_server.launch.py
```
Run example application with an absolute path of an image on another console:
```bash
@@ -196,3 +198,4 @@ This project is a ROS2 wrapper for CV API of [OpenVINO™](https://software.inte
```
> solution - Please reboot while connecting Intel® Neural Compute Stick 2.
+
diff --git a/dynamic_vino_lib/CMakeLists.txt b/dynamic_vino_lib/CMakeLists.txt
index 6dfdb946..c26ae236 100644
--- a/dynamic_vino_lib/CMakeLists.txt
+++ b/dynamic_vino_lib/CMakeLists.txt
@@ -12,16 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cmake_minimum_required (VERSION 3.5)
+cmake_minimum_required(VERSION 3.5)
project(dynamic_vino_lib)
-list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
####################################
## to use C++14
-set (CMAKE_CXX_STANDARD 14)
-set (CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
####################################
@@ -32,7 +32,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)
-if (NOT InferenceEngine_FOUND)
+if(NOT InferenceEngine_FOUND)
message(FATAL_ERROR "")
endif()
@@ -62,7 +62,7 @@ find_package(cv_bridge REQUIRED)
find_package(vino_param_lib REQUIRED)
find_package(yaml_cpp_vendor REQUIRED)
-set (CpuExtension_lib $ENV{CPU_EXTENSION_LIB})
+set(CpuExtension_lib $ENV{CPU_EXTENSION_LIB})
add_library(cpu_extension SHARED IMPORTED)
set_target_properties(cpu_extension PROPERTIES
@@ -74,46 +74,46 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE "Release")
endif()
-if (NOT(BIN_FOLDER))
+if(NOT(BIN_FOLDER))
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
- set (ARCH intel64)
+ set(ARCH intel64)
else()
- set (ARCH ia32)
+ set(ARCH ia32)
endif()
- set (BIN_FOLDER ${ARCH})
+ set(BIN_FOLDER ${ARCH})
endif()
-if (NOT (IE_MAIN_SOURCE_DIR))
+if(NOT (IE_MAIN_SOURCE_DIR))
set(NEED_EXTENSIONS TRUE)
- if (WIN32)
- set (IE_MAIN_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../bin/)
+ if(WIN32)
+ set(IE_MAIN_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../bin/)
else()
- set (IE_MAIN_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ set(IE_MAIN_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif()
endif()
if(NOT(UNIX))
- set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
- set (CMAKE_LIBRARY_PATH ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
- set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
- set (CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
- set (CMAKE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
- set (LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
- set (LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_DIRECTORY}) # compatibility issue: linux uses LIBRARY_OUTPUT_PATH, windows uses LIBRARY_OUTPUT_DIRECTORY
-else ()
- set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
- set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
- set (CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE})
- set (CMAKE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE})
- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE})
- set (LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
- set (LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_DIRECTORY}/lib)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
+ set(CMAKE_LIBRARY_PATH ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
+ set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
+ set(CMAKE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
+ set(LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER})
+ set(LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_DIRECTORY}) # compatibility issue: linux uses LIBRARY_OUTPUT_PATH, windows uses LIBRARY_OUTPUT_DIRECTORY
+else()
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
+ set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE})
+ set(CMAKE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE})
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE})
+ set(LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SOURCE_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
+ set(LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_DIRECTORY}/lib)
endif()
-if (WIN32)
+if(WIN32)
if(NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
message(FATAL_ERROR "Only 64-bit supported on Windows")
endif()
@@ -122,16 +122,16 @@ if (WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") #no asynchronous structured exception handling
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
- if (ENABLE_OMP)
+ if(ENABLE_OMP)
find_package(OpenMP)
- if (OPENMP_FOUND)
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+ if(OPENMP_FOUND)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Werror=return-type ")
- if (APPLE)
+ if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-command-line-argument")
elseif(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -Winit-self -Wmaybe-uninitialized")
@@ -152,10 +152,14 @@ if(UNIX OR APPLE)
endif()
endif()
-include(feature_defs OPTIONAL)
+#The below command is commented in order to ignore "colcon test" errors.
+#This maybe impacts CPU's inference tuning, although we tested on Core i7-6700 and got the similar performance.
+#If you concern the inference performence, you can try to get the resource from the follow url and enable the below line.
+#https://github.com/opencv/dldt/tree/2018/inference-engine/src/extension/cmake
+#include(feature_defs OPTIONAL)
# Properties->C/C++->General->Additional Include Directories
-include_directories (
+include_directories(
# ${CMAKE_CURRENT_SOURCE_DIR}/common/format_reader
${CMAKE_CURRENT_SOURCE_DIR}/include
${InferenceEngine_INCLUDE_DIRS}
@@ -165,8 +169,8 @@ include_directories (
${librealsense2_INCLUDE_DIRS}
)
-if (UNIX)
- SET(LIB_DL dl)
+if(UNIX)
+ set(LIB_DL dl)
endif()
set(DEPENDENCIES ${librealsense2_LIBRARIES} ${OpenCV_LIBS} cpu_extension)
@@ -202,7 +206,7 @@ add_library(${PROJECT_NAME} SHARED
src/outputs/rviz_output.cpp
src/outputs/base_output.cpp
src/outputs/ros_service_output.cpp
- )
+)
target_link_libraries(${PROJECT_NAME} ${DEPENDENCIES})
diff --git a/dynamic_vino_lib/cmake/CPUID.cmake b/dynamic_vino_lib/cmake/CPUID.cmake
deleted file mode 100644
index 904a65cb..00000000
--- a/dynamic_vino_lib/cmake/CPUID.cmake
+++ /dev/null
@@ -1,353 +0,0 @@
-# the module will build and run cpuid utility, which store detected
-# host processor features into cpuid.txt file in form:
-# FEATURE [not] supported
-# variable HAVE_CPUID_INFO set in case of success
-# if variable HAVE_CPUID_INFO is set then it is possible
-# to test HAVE_SSE42/HAVE_AVX2 variables
-
-include (CheckCXXSourceRuns)
-
-if(NOT WIN32)
- set(CMAKE_REQUIRED_FLAGS "-std=c++11")
-endif()
-
-check_cxx_source_runs(
-"
-// InstructionSet.cpp
-// Compile by using: cl /EHsc /W4 InstructionSet.cpp
-// processor: x86, x64
-// Uses the __cpuid intrinsic to get information about
-// CPU extended instruction set support.
-//
-// source origin:
-// https://msdn.microsoft.com/en-us/library/hskdteyh.aspx
-// https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=gcc/config/i386/driver-i386.c
-
-
-#include
-#include
-#include
-#include
-#include
-#include
-#ifdef WIN32
-#include
-#else
-#include
-#include
-#endif
-
-class InstructionSet
-{
- // forward declarations
- class InstructionSet_Internal;
-
-public:
- // getters
- static std::string Vendor(void) { return CPU_Rep.vendor_; }
- static std::string Brand(void) { return CPU_Rep.brand_; }
-
- static bool SSE3(void) { return CPU_Rep.f_1_ECX_[0]; }
- static bool PCLMULQDQ(void) { return CPU_Rep.f_1_ECX_[1]; }
- static bool MONITOR(void) { return CPU_Rep.f_1_ECX_[3]; }
- static bool SSSE3(void) { return CPU_Rep.f_1_ECX_[9]; }
- static bool FMA(void) { return CPU_Rep.f_1_ECX_[12]; }
- static bool CMPXCHG16B(void) { return CPU_Rep.f_1_ECX_[13]; }
- static bool SSE41(void) { return CPU_Rep.f_1_ECX_[19]; }
- static bool SSE42(void) { return CPU_Rep.f_1_ECX_[20]; }
- static bool MOVBE(void) { return CPU_Rep.f_1_ECX_[22]; }
- static bool POPCNT(void) { return CPU_Rep.f_1_ECX_[23]; }
- static bool AES(void) { return CPU_Rep.f_1_ECX_[25]; }
- static bool XSAVE(void) { return CPU_Rep.f_1_ECX_[26]; }
- static bool OSXSAVE(void) { return CPU_Rep.f_1_ECX_[27]; }
- static bool AVX(void) { return CPU_Rep.f_1_ECX_[28]; }
- static bool F16C(void) { return CPU_Rep.f_1_ECX_[29]; }
- static bool RDRAND(void) { return CPU_Rep.f_1_ECX_[30]; }
-
- static bool MSR(void) { return CPU_Rep.f_1_EDX_[5]; }
- static bool CX8(void) { return CPU_Rep.f_1_EDX_[8]; }
- static bool SEP(void) { return CPU_Rep.f_1_EDX_[11]; }
- static bool CMOV(void) { return CPU_Rep.f_1_EDX_[15]; }
- static bool CLFSH(void) { return CPU_Rep.f_1_EDX_[19]; }
- static bool MMX(void) { return CPU_Rep.f_1_EDX_[23]; }
- static bool FXSR(void) { return CPU_Rep.f_1_EDX_[24]; }
- static bool SSE(void) { return CPU_Rep.f_1_EDX_[25]; }
- static bool SSE2(void) { return CPU_Rep.f_1_EDX_[26]; }
-
- static bool FSGSBASE(void) { return CPU_Rep.f_7_EBX_[0]; }
- static bool BMI1(void) { return CPU_Rep.f_7_EBX_[3]; }
- static bool HLE(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_7_EBX_[4]; }
- static bool AVX2(void) { return CPU_Rep.f_7_EBX_[5]; }
- static bool BMI2(void) { return CPU_Rep.f_7_EBX_[8]; }
- static bool ERMS(void) { return CPU_Rep.f_7_EBX_[9]; }
- static bool INVPCID(void) { return CPU_Rep.f_7_EBX_[10]; }
- static bool RTM(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_7_EBX_[11]; }
- static bool AVX512F(void) { return CPU_Rep.f_7_EBX_[16]; }
- static bool RDSEED(void) { return CPU_Rep.f_7_EBX_[18]; }
- static bool ADX(void) { return CPU_Rep.f_7_EBX_[19]; }
- static bool AVX512PF(void) { return CPU_Rep.f_7_EBX_[26]; }
- static bool AVX512ER(void) { return CPU_Rep.f_7_EBX_[27]; }
- static bool AVX512CD(void) { return CPU_Rep.f_7_EBX_[28]; }
- static bool SHA(void) { return CPU_Rep.f_7_EBX_[29]; }
-
- static bool PREFETCHWT1(void) { return CPU_Rep.f_7_ECX_[0]; }
-
- static bool LAHF(void) { return CPU_Rep.f_81_ECX_[0]; }
- static bool LZCNT(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_81_ECX_[5]; }
- static bool ABM(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_ECX_[5]; }
- static bool SSE4a(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_ECX_[6]; }
- static bool XOP(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_ECX_[11]; }
- static bool TBM(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_ECX_[21]; }
-
- static bool SYSCALL(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_81_EDX_[11]; }
- static bool MMXEXT(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_EDX_[22]; }
- static bool RDTSCP(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_81_EDX_[27]; }
- static bool _3DNOWEXT(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_EDX_[30]; }
- static bool _3DNOW(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_EDX_[31]; }
-
-private:
- static const InstructionSet_Internal CPU_Rep;
-
- class InstructionSet_Internal
- {
- public:
- InstructionSet_Internal()
- : nIds_{ 0 },
- nExIds_{ 0 },
- isIntel_{ false },
- isAMD_{ false },
- f_1_ECX_{ 0 },
- f_1_EDX_{ 0 },
- f_7_EBX_{ 0 },
- f_7_ECX_{ 0 },
- f_81_ECX_{ 0 },
- f_81_EDX_{ 0 },
- data_{},
- extdata_{}
- {
-#ifdef WIN32
- std::array cpui;
-#else
- std::array cpui;
-#endif
-
- // Calling __cpuid with 0x0 as the function_id argument
- // gets the number of the highest valid function ID.
-#ifdef WIN32
- __cpuid(cpui.data(), 0);
-#else
- cpui[0] = __get_cpuid_max(0, &cpui[1]);
-#endif
- nIds_ = cpui[0];
-
- for (int i = 0; i <= nIds_; ++i)
- {
-#ifdef WIN32
- __cpuidex(cpui.data(), i, 0);
-#else
- __cpuid_count(i, 0, cpui[0], cpui[1], cpui[2], cpui[3]);
-#endif
-
- data_.push_back(cpui);
- }
-
- // Capture vendor string
- char vendor[0x20];
- memset(vendor, 0, sizeof(vendor));
- *reinterpret_cast(vendor + 0) = data_[0][1];
- *reinterpret_cast(vendor + 4) = data_[0][3];
- *reinterpret_cast(vendor + 8) = data_[0][2];
- vendor_ = vendor;
- if (vendor_ == \"GenuineIntel\")
- {
- isIntel_ = true;
- }
- else if (vendor_ == \"AuthenticAMD\")
- {
- isAMD_ = true;
- }
-
- // load bitset with flags for function 0x00000001
- if (nIds_ >= 1)
- {
- f_1_ECX_ = data_[1][2];
- f_1_EDX_ = data_[1][3];
- }
-
- // load bitset with flags for function 0x00000007
- if (nIds_ >= 7)
- {
- f_7_EBX_ = data_[7][1];
- f_7_ECX_ = data_[7][2];
- }
-
- // Calling __cpuid with 0x80000000 as the function_id argument
- // gets the number of the highest valid extended ID.
-#ifdef WIN32
- __cpuid(cpui.data(), 0x80000000);
-#else
- __cpuid(0x80000000, cpui[0], cpui[1], cpui[2], cpui[3]);
-#endif
- nExIds_ = cpui[0];
-
- char brand[0x40];
- memset(brand, 0, sizeof(brand));
-
- for (int i = 0x80000000; i <= nExIds_; ++i)
- {
-#ifdef WIN32
- __cpuidex(cpui.data(), i, 0);
-#else
- __cpuid_count(i, 0, cpui[0], cpui[1], cpui[2], cpui[3]);
-#endif
- extdata_.push_back(cpui);
- }
-
- // load bitset with flags for function 0x80000001
- if (nExIds_ >= 0x80000001)
- {
- f_81_ECX_ = extdata_[1][2];
- f_81_EDX_ = extdata_[1][3];
- }
-
- // Interpret CPU brand string if reported
- if (nExIds_ >= 0x80000004)
- {
- memcpy(brand + 0, extdata_[2].data(), sizeof(cpui));
- memcpy(brand + 16, extdata_[3].data(), sizeof(cpui));
- memcpy(brand + 32, extdata_[4].data(), sizeof(cpui));
- brand_ = brand;
- }
- };
-
- int nIds_;
- int nExIds_;
- std::string vendor_;
- std::string brand_;
- bool isIntel_;
- bool isAMD_;
- std::bitset<32> f_1_ECX_;
- std::bitset<32> f_1_EDX_;
- std::bitset<32> f_7_EBX_;
- std::bitset<32> f_7_ECX_;
- std::bitset<32> f_81_ECX_;
- std::bitset<32> f_81_EDX_;
-#ifdef WIN32
- std::vector> data_;
- std::vector> extdata_;
-#else
- std::vector> data_;
- std::vector> extdata_;
-#endif
- };
-};
-
-// Initialize static member data
-const InstructionSet::InstructionSet_Internal InstructionSet::CPU_Rep;
-
-// Print out supported instruction set extensions
-int main()
-{
- std::ofstream fo(\"cpuid.txt\");
- auto& outstream = fo;//std::cout;
-
- auto support_message = [&outstream](std::string isa_feature, bool is_supported) {
- outstream << isa_feature << (is_supported ? \" supported\" : \" not supported\") << std::endl;
- };
-
- std::cout << InstructionSet::Vendor() << std::endl;
- std::cout << InstructionSet::Brand() << std::endl;
-
- support_message(\"3DNOW\", InstructionSet::_3DNOW());
- support_message(\"3DNOWEXT\", InstructionSet::_3DNOWEXT());
- support_message(\"ABM\", InstructionSet::ABM());
- support_message(\"ADX\", InstructionSet::ADX());
- support_message(\"AES\", InstructionSet::AES());
- support_message(\"AVX\", InstructionSet::AVX());
- support_message(\"AVX2\", InstructionSet::AVX2());
- support_message(\"AVX512CD\", InstructionSet::AVX512CD());
- support_message(\"AVX512F\", InstructionSet::AVX512F());
- support_message(\"AVX512ER\", InstructionSet::AVX512ER());
- support_message(\"AVX512PF\", InstructionSet::AVX512PF());
- support_message(\"BMI1\", InstructionSet::BMI1());
- support_message(\"BMI2\", InstructionSet::BMI2());
- support_message(\"CLFSH\", InstructionSet::CLFSH());
- support_message(\"CMPXCHG16B\", InstructionSet::CMPXCHG16B());
- support_message(\"CX8\", InstructionSet::CX8());
- support_message(\"ERMS\", InstructionSet::ERMS());
- support_message(\"F16C\", InstructionSet::F16C());
- support_message(\"FMA\", InstructionSet::FMA());
- support_message(\"FSGSBASE\", InstructionSet::FSGSBASE());
- support_message(\"FXSR\", InstructionSet::FXSR());
- support_message(\"HLE\", InstructionSet::HLE());
- support_message(\"INVPCID\", InstructionSet::INVPCID());
- support_message(\"LAHF\", InstructionSet::LAHF());
- support_message(\"LZCNT\", InstructionSet::LZCNT());
- support_message(\"MMX\", InstructionSet::MMX());
- support_message(\"MMXEXT\", InstructionSet::MMXEXT());
- support_message(\"MONITOR\", InstructionSet::MONITOR());
- support_message(\"MOVBE\", InstructionSet::MOVBE());
- support_message(\"MSR\", InstructionSet::MSR());
- support_message(\"OSXSAVE\", InstructionSet::OSXSAVE());
- support_message(\"PCLMULQDQ\", InstructionSet::PCLMULQDQ());
- support_message(\"POPCNT\", InstructionSet::POPCNT());
- support_message(\"PREFETCHWT1\", InstructionSet::PREFETCHWT1());
- support_message(\"RDRAND\", InstructionSet::RDRAND());
- support_message(\"RDSEED\", InstructionSet::RDSEED());
- support_message(\"RDTSCP\", InstructionSet::RDTSCP());
- support_message(\"RTM\", InstructionSet::RTM());
- support_message(\"SEP\", InstructionSet::SEP());
- support_message(\"SHA\", InstructionSet::SHA());
- support_message(\"SSE\", InstructionSet::SSE());
- support_message(\"SSE2\", InstructionSet::SSE2());
- support_message(\"SSE3\", InstructionSet::SSE3());
- support_message(\"SSE4.1\", InstructionSet::SSE41());
- support_message(\"SSE4.2\", InstructionSet::SSE42());
- support_message(\"SSE4a\", InstructionSet::SSE4a());
- support_message(\"SSSE3\", InstructionSet::SSSE3());
- support_message(\"SYSCALL\", InstructionSet::SYSCALL());
- support_message(\"TBM\", InstructionSet::TBM());
- support_message(\"XOP\", InstructionSet::XOP());
- support_message(\"XSAVE\", InstructionSet::XSAVE());
- return 0;
-}
-"
-HAVE_CPUID_INFO
-)
-
-if(HAVE_CPUID_INFO)
- set(_CPUID_INFO "${CMAKE_BINARY_DIR}/cpuid.txt")
- set(HAVE_AVX512F FALSE)
- set(HAVE_AVX2 FALSE)
- set(HAVE_SSE42 FALSE)
-
- file(STRINGS ${_CPUID_INFO} _FEATURES)
-
- message(STATUS "Host CPU features:")
-
- foreach(FEATURE IN ITEMS ${_FEATURES})
-
- message(STATUS " ${FEATURE}")
-
- string(COMPARE EQUAL "${FEATURE}" "AVX512F supported" _FEATURE_FOUND)
- if(${_FEATURE_FOUND})
- if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9)
- set(HAVE_AVX512F ${_FEATURE_FOUND})
- else()
- message(WARNING "Compiler doesn't support AVX512 instructuion set")
- endif()
- endif()
- string(COMPARE EQUAL "${FEATURE}" "AVX2 supported" _FEATURE_FOUND)
- if(${_FEATURE_FOUND})
- set(HAVE_AVX2 ${_FEATURE_FOUND})
- endif()
- string(COMPARE EQUAL "${FEATURE}" "SSE4.2 supported" _FEATURE_FOUND)
- if(${_FEATURE_FOUND})
- set(HAVE_SSE42 ${_FEATURE_FOUND})
- endif()
- endforeach(FEATURE)
-
- unset(_FEATURE_FOUND)
- unset(_CPUID_INFO)
- unset(_FEATURES)
-endif()
diff --git a/dynamic_vino_lib/cmake/OptimizationFlags.cmake b/dynamic_vino_lib/cmake/OptimizationFlags.cmake
deleted file mode 100644
index 8e87ea46..00000000
--- a/dynamic_vino_lib/cmake/OptimizationFlags.cmake
+++ /dev/null
@@ -1,180 +0,0 @@
-#
-# service functions:
-# set_target_cpu_flags
-# set_target_vectorizer_report_flags
-# print_target_compiler_options
-
-
-# set processor speicif compilation options, based either on
-# externally defined ENABLE_SSE42/ENABLE_AVX2 options or
-# based on detected host processor featured (HAVE_SSE/HAVE_AVX2)
-# Note, when ENABLE_AVX2 option is on by any means then ENABLE_SSE42 option
-# will be turned on if not set explicitely
-
-
-function(set_target_cpu_flags TARGET_NAME)
- # if have cpuid info and not requested specific cpu features externally
- # turn on cpu specific compile options based on detected features
- # of host processor
- # if don't have cpuid info or cpu specific features explicitly requested
- # set compile options based on requested features
- if(${HAVE_CPUID_INFO})
- # ENABLE_SSE42, ENABLE_AVX2, ENABLE_AVX512 weren't set explicitly,
- # so derive it from host cpu features
- if( (NOT DEFINED ENABLE_SSE42) AND (NOT DEFINED ENABLE_AVX2) AND (NOT DEFINED ENABLE_AVX512F) )
- set(ENABLE_SSE42 ${HAVE_SSE42})
- set(ENABLE_AVX2 ${HAVE_AVX2})
- set(ENABLE_AVX512F ${HAVE_AVX512F})
- endif()
- # ENABLE_SSE42 was set explicitly, ENABLE_AVX2 and ENABLE_AVX512F were not defined.
- # Consider as request to build for Atom, turn off AVX2 and AVX512
- if( (${ENABLE_SSE42}) AND (NOT DEFINED ENABLE_AVX2) AND (NOT DEFINED ENABLE_AVX512F) )
- set(ENABLE_AVX2 OFF)
- set(ENABLE_AVX512F OFF)
- endif()
- # ENABLE_AVX2 was set explicitly, ENABLE_SSE42 and ENABLE_AVX512F were not defined
- # Consider as request to build for Core, turn on SSE42 as supported feature
- if( (NOT DEFINED ENABLE_SSE42) AND (${ENABLE_AVX2}) AND (NOT DEFINED ENABLE_AVX512F) )
- set(ENABLE_SSE42 ON)
- set(ENABLE_AVX512F OFF)
- endif()
- # ENABLE_AVX512 was set explicitly, ENABLE_SSE42 and ENABLE_AVX2 were not defined
- # Consider as request to build for Xeon (Skylake server and later), turn on SSE42 and AVX2 as supported feature
- if( (NOT DEFINED ENABLE_SSE42) AND (NOT DEFINED ENABLE_AVX2) AND (${ENABLE_AVX512F}) )
- set(ENABLE_SSE42 ON)
- set(ENABLE_AVX2 ON)
- endif()
- endif()
-
- if(WIN32)
- if(${ENABLE_AVX512F})
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_SSE")
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_AVX2")
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_AVX512F")
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- target_compile_options(${TARGET_NAME} PUBLIC "/QxCOMMON-AVX512")
- target_compile_options(${TARGET_NAME} PUBLIC "/Qvc14")
- endif()
- if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- message(WARNING "MSVC Compiler doesn't support AVX512 instructuion set")
- endif()
- elseif(${ENABLE_AVX2})
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_SSE")
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_AVX2")
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- target_compile_options(${TARGET_NAME} PUBLIC "/QxCORE-AVX2")
- target_compile_options(${TARGET_NAME} PUBLIC "/Qvc14")
- endif()
- if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- target_compile_options(${TARGET_NAME} PUBLIC "/arch:AVX2")
- endif()
- elseif(${ENABLE_SSE42})
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_SSE")
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- target_compile_options(${TARGET_NAME} PUBLIC "/arch:SSE4.2")
- target_compile_options(${TARGET_NAME} PUBLIC "/QxSSE4.2")
- target_compile_options(${TARGET_NAME} PUBLIC "/Qvc14")
- endif()
- if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- target_compile_options(${TARGET_NAME} PUBLIC "/arch:SSE4.2")
- endif()
- endif()
- endif()
- if(UNIX)
- if(${ENABLE_AVX512F})
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_SSE")
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_AVX2")
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_AVX512F")
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- target_compile_options(${TARGET_NAME} PUBLIC "-xCOMMON-AVX512")
- endif()
- if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- target_compile_options(${TARGET_NAME} PUBLIC "-mavx512f")
- target_compile_options(${TARGET_NAME} PUBLIC "-mfma")
- endif()
- elseif(${ENABLE_AVX2})
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_SSE")
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_AVX2")
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- target_compile_options(${TARGET_NAME} PUBLIC "-march=core-avx2")
- target_compile_options(${TARGET_NAME} PUBLIC "-xCORE-AVX2")
- target_compile_options(${TARGET_NAME} PUBLIC "-mtune=core-avx2")
- endif()
- if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- target_compile_options(${TARGET_NAME} PUBLIC "-mavx2")
- target_compile_options(${TARGET_NAME} PUBLIC "-mfma")
- endif()
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- target_compile_options(${TARGET_NAME} PUBLIC "-mavx2")
- target_compile_options(${TARGET_NAME} PUBLIC "-mfma")
- endif()
- elseif(${ENABLE_SSE42})
- target_compile_definitions(${TARGET_NAME} PUBLIC "-DHAVE_SSE")
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- target_compile_options(${TARGET_NAME} PUBLIC "-msse4.2")
- target_compile_options(${TARGET_NAME} PUBLIC "-xSSE4.2")
- endif()
- if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- target_compile_options(${TARGET_NAME} PUBLIC "-msse4.2")
- endif()
- endif()
- endif()
-endfunction()
-
-
-# function set vectorization report flags in case of
-# Intel compiler (might be useful for analisys of which loops were not
-# vectorized and why)
-function(set_target_vectorizer_report_flags TARGET_NAME)
- if(WIN32)
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- target_compile_options(${TARGET_NAME} PUBLIC "/Qopt-report=3")
- target_compile_options(${TARGET_NAME} PUBLIC "/Qopt-report-format=vs")
- target_compile_options(${TARGET_NAME} PUBLIC "/Qopt-report-per-object")
- endif()
- endif()
- if(UNIX)
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- target_compile_options(${TARGET_NAME} PUBLIC "-qopt-report=3")
- target_compile_options(${TARGET_NAME} PUBLIC "-qopt-report-format=text")
- target_compile_options(${TARGET_NAME} PUBLIC "-qopt-report-per-object")
- endif()
- endif()
-endfunction()
-
-
-# function print target compiler options to console
-function(print_target_compiler_options TARGET_NAME)
-
- if(NOT TARGET ${TARGET_NAME})
- message("There is no target named '${TARGET_NAME}'")
- return()
- endif()
-
- message(STATUS "Target ${TARGET_NAME}")
- message(STATUS " compiler definitions:")
- get_target_property(TARGET_COMPILE_DEFINITIONS ${TARGET_NAME} COMPILE_DEFINITIONS)
- if(TARGET_COMPILE_DEFINITIONS)
- message(STATUS " ${TARGET_COMPILE_DEFINITIONS}")
- else()
- message(STATUS " not set")
- endif()
- message(STATUS " compiler options:")
- get_target_property(TARGET_COMPILE_OPTIONS ${TARGET_NAME} COMPILE_OPTIONS)
- if(TARGET_COMPILE_OPTIONS)
- message(STATUS " ${TARGET_COMPILE_OPTIONS}")
- else()
- message(STATUS " not set")
- endif()
- message(STATUS " compiler flags:")
- get_target_property(TARGET_COMPILE_FLAGS ${TARGET_NAME} COMPILE_FLAGS)
- if(TARGET_COMPILE_FLAGS)
- message(STATUS " ${TARGET_COMPILE_FLAGS}")
- else()
- message(STATUS " not set")
- endif()
-
- message(STATUS " CXX_FLAGS:")
- message(STATUS " ${CMAKE_CXX_FLAGS}")
-
-endfunction()
diff --git a/dynamic_vino_lib/cmake/feature_defs.cmake b/dynamic_vino_lib/cmake/feature_defs.cmake
deleted file mode 100644
index 52eb5130..00000000
--- a/dynamic_vino_lib/cmake/feature_defs.cmake
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright (c) 2018 Intel Corporation
-#
-# 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.
-
-cmake_minimum_required (VERSION 2.8)
-
-include(CPUID)
-include(OptimizationFlags)
-
-set(OpenCV_STATIC OFF)
-
-find_package(OpenCV 3.3 COMPONENTS core imgproc highgui imgcodecs)
-if(NOT(OpenCV_FOUND))
- find_package(OpenCV 3.3 REQUIRED world)
-endif()
-set (BUILD_VALIDATION_APP OFF)
-if (OpenCV_FOUND)
- set (BUILD_VALIDATION_APP ON)
-endif()
-
-macro(enable_omp)
- if(UNIX) # Linux
- add_definitions(-fopenmp)
- find_library(intel_omp_lib iomp5
- PATHS ${InferenceEngine_INCLUDE_DIRS}/../external/mkltiny_lnx/lib
- )
- elseif(WIN32) # Windows
- if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
- set(OPENMP_FLAGS "/Qopenmp /openmp")
- set(CMAKE_SHARED_LINKER_FLAGS " ${CMAKE_SHARED_LINKER_FLAGS} /nodefaultlib:vcomp")
- elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
- set(OPENMP_FLAGS "/Qopenmp /openmp")
- else()
- message("Unknown compiler ID. OpenMP support is disabled.")
- endif()
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPENMP_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENMP_FLAGS}")
- find_library(intel_omp_lib
- libiomp5md
- PATHS "${InferenceEngine_INCLUDE_DIRS}/../lib/intel64/${CMAKE_BUILD_TYPE}"
- )
- endif()
-endmacro(enable_omp)
diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/args_helper.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/args_helper.hpp
index b99cb995..9b1e00b8 100644
--- a/dynamic_vino_lib/include/dynamic_vino_lib/args_helper.hpp
+++ b/dynamic_vino_lib/include/dynamic_vino_lib/args_helper.hpp
@@ -1,18 +1,16 @@
-/*
- * Copyright (c) 2018 Intel Corporation
- *
- * 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.
- */
+// Copyright (c) 2018 Intel Corporation
+//
+// 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.
/**
* @brief a header file with common samples functionality
@@ -37,29 +35,29 @@
/**
* @brief This function check input args and find images in given folder
*/
-void readImagesArguments(std::vector& images,
- const std::string& arg) {
+void readImagesArguments(std::vector & images, const std::string & arg)
+{
struct stat sb;
if (stat(arg.c_str(), &sb) != 0) {
- std::cout << "[ WARNING ] File " << arg << " cannot be opened!"
- << std::endl;
+ std::cout << "[ WARNING ] File " << arg << " cannot be opened!" << std::endl;
return;
}
if (S_ISDIR(sb.st_mode)) {
- DIR* dp;
+ DIR * dp;
dp = opendir(arg.c_str());
if (dp == nullptr) {
- std::cout << "[ WARNING ] Directory " << arg << " cannot be opened!"
- << std::endl;
+ std::cout << "[ WARNING ] Directory " << arg << " cannot be opened!" << std::endl;
return;
}
- struct dirent* ep;
+ struct dirent * ep;
while (nullptr != (ep = readdir(dp))) {
std::string fileName = ep->d_name;
- if (fileName == "." || fileName == "..") continue;
- std::cout << "[ INFO ] Add file " << ep->d_name << " from directory "
- << arg << "." << std::endl;
+ if (fileName == "." || fileName == "..") {
+ continue;
+ }
+ std::cout << "[ INFO ] Add file " << ep->d_name << " from directory " << arg << "." <<
+ std::endl;
images.push_back(arg + "/" + ep->d_name);
}
} else {
@@ -71,7 +69,8 @@ void readImagesArguments(std::vector& images,
* @brief This function find -i/--images key in input args
* It's necessary to process multiple values for single key
*/
-void parseImagesArguments(std::vector& images) {
+void parseImagesArguments(std::vector & images)
+{
std::vector args = gflags::GetArgvs();
bool readArguments = false;
for (size_t i = 0; i < args.size(); i++) {
diff --git a/dynamic_vino_lib/include/dynamic_vino_lib/common.hpp b/dynamic_vino_lib/include/dynamic_vino_lib/common.hpp
index 1e2d542e..ad6548cb 100644
--- a/dynamic_vino_lib/include/dynamic_vino_lib/common.hpp
+++ b/dynamic_vino_lib/include/dynamic_vino_lib/common.hpp
@@ -1,26 +1,31 @@
-/*
// Copyright (c) 2018 Intel Corporation
//
// 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
+// 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.
-*/
-/**
- * @brief a header file with common samples functionality
- * @file common.hpp
- */
+//
+// @brief a header file with common samples functionality
+// @file common.hpp
+//
-#pragma once
+#ifndef DYNAMIC_VINO_LIB__COMMON_HPP_
+#define DYNAMIC_VINO_LIB__COMMON_HPP_
+#include
+#include
+#include
+#include
+#include
+#include
#include
#include