浏览代码

fix openvino glog

syyxsxx 5 年之前
父节点
当前提交
34c03d1467

+ 2 - 10
deploy/openvino/CMakeLists.txt

@@ -8,7 +8,6 @@ SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
 SET(OPENVINO_DIR "" CACHE PATH "Location of libraries")
 SET(OPENCV_DIR "" CACHE PATH "Location of libraries")
 SET(GFLAGS_DIR "" CACHE PATH "Location of libraries")
-SET(GLOG_DIR "" CACHE PATH "Location of libraries")
 SET(NGRAPH_LIB "" CACHE PATH "Location of libraries")
 SET(ARCH "" CACHE PATH "Location of libraries")
 
@@ -47,9 +46,6 @@ if (NOT DEFINED GFLAGS_DIR OR ${GFLAGS_DIR} STREQUAL "")
     message(FATAL_ERROR "please set GFLAGS_DIR with -DGFLAGS_DIR=/path/gflags")
 endif()
 
-if (NOT DEFINED GLOG_DIR OR ${GLOG_DIR} STREQUAL "")
-    message(FATAL_ERROR "please set GLOG_DIR with -DLOG_DIR=/path/glog")
-endif()
 
 if (NOT DEFINED NGRAPH_LIB OR ${NGRAPH_LIB} STREQUAL "")
     message(FATAL_ERROR "please set NGRAPH_DIR with -DNGRAPH_DIR=/path/ngraph")
@@ -70,9 +66,6 @@ endif()
 link_directories("${GFLAGS_DIR}/lib")
 include_directories("${GFLAGS_DIR}/include")
 
-link_directories("${GLOG_DIR}/lib")
-include_directories("${GLOG_DIR}/include")
-
 link_directories("${NGRAPH_LIB}")
 link_directories("${NGRAPH_LIB}/lib")
 
@@ -86,7 +79,6 @@ endif ()
 include_directories(${OpenCV_INCLUDE_DIRS})
 
 if (WIN32)
-    add_definitions("/DGOOGLE_GLOG_DLL_DECL=")
     set(CMAKE_C_FLAGS_DEBUG   "${CMAKE_C_FLAGS_DEBUG} /bigobj /MTd")
     set(CMAKE_C_FLAGS_RELEASE  "${CMAKE_C_FLAGS_RELEASE} /bigobj /MT")
     set(CMAKE_CXX_FLAGS_DEBUG  "${CMAKE_CXX_FLAGS_DEBUG} /bigobj /MTd")
@@ -126,11 +118,11 @@ endif(WIN32)
 
 if (NOT WIN32)
     set(DEPS ${DEPS}
-        glog gflags  z  yaml-cpp
+        gflags yaml-cpp
         )
 else()
     set(DEPS ${DEPS}
-        glog gflags_static  libyaml-cppmt)
+        gflags_static  libyaml-cppmt)
     set(DEPS ${DEPS} libcmt shlwapi)
 endif(NOT WIN32)
 

+ 1 - 6
deploy/openvino/CMakeSettings.json

@@ -35,13 +35,8 @@
           "name": "WITH_STATIC_LIB",
           "value": "True",
           "type": "BOOL"
-        },
-        {
-          "name": "GLOG_DIR",
-          "value": "/path/to/glog",
-          "type": "PATH"
         }
       ]
     }
   ]
-}
+}

+ 1 - 1
deploy/openvino/demo/classifier.cpp

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <glog/logging.h>
+#include <gflags/gflags.h>
 
 #include <fstream>
 #include <iostream>

+ 1 - 2
deploy/openvino/demo/detector.cpp

@@ -12,8 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <glog/logging.h>
-#include <omp.h>
+#include <gflags/gflags.h>
 
 #include <algorithm>
 #include <chrono>  // NOLINT

+ 1 - 1
deploy/openvino/demo/segmenter.cpp

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <glog/logging.h>
+#include <gflags/gflags.h>
 
 #include <algorithm>
 #include <fstream>

+ 1 - 1
deploy/openvino/python/converter.py

@@ -68,7 +68,7 @@ def export_openvino_model(model, args):
     onnx_parser.add_argument("--model_dir", type=_text_type)
     onnx_parser.add_argument("--save_dir", type=_text_type)
     onnx_parser.add_argument("--fixed_input_shape")
-    onnx_input = os.path.join(args.save_dir, 'x2paddle_model.onnx')
+    onnx_input = os.path.join(args.save_dir, 'paddle2onnx_model.onnx')
     onnx_parser.set_defaults(input_model=onnx_input)
     onnx_parser.set_defaults(output_dir=args.save_dir)
     shape_list = args.fixed_input_shape[1:-1].split(',')

+ 0 - 11
deploy/openvino/scripts/install_third-party.sh

@@ -11,17 +11,6 @@ if [ ! -d "./deps/gflag" ]; then
     cd ..
     cd ..
 fi
-if [ ! -d "./deps/glog" ]; then
-    cd deps
-    git clone https://github.com/google/glog
-    sudo apt-get install autoconf automake libtool
-    cd glog
-    ./autogen.sh
-    ./configure
-    make -j 8
-    cd ..
-    cd ..
-fi
 
 if [ "$ARCH" = "x86" ]; then
     OPENCV_URL=https://bj.bcebos.com/paddlex/deploy/x86opencv/opencv.tar.bz2

+ 1 - 1
deploy/raspberry/demo/classifier.cpp

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <glog/logging.h>
+#include <gflags/gflags.h>
 
 #include <fstream>
 #include <iostream>

+ 1 - 2
deploy/raspberry/demo/detector.cpp

@@ -12,8 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <glog/logging.h>
-#include <omp.h>
+#include <gflags/gflags.h>
 
 #include <algorithm>
 #include <chrono>  // NOLINT

+ 1 - 1
deploy/raspberry/demo/segmenter.cpp

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <glog/logging.h>
+#include <gflags/gflags.h>
 
 #include <algorithm>
 #include <fstream>

+ 0 - 2
deploy/raspberry/scripts/build.sh

@@ -3,8 +3,6 @@ LITE_DIR=/path/to/Paddle-Lite/inference/lib
 
 # gflags预编译库的路径
 GFLAGS_DIR=$(pwd)/deps/gflags
-# glog预编译库的路径
-GLOG_DIR=$(pwd)/deps/glog
 
 # opencv预编译库的路径, 如果使用自带预编译版本可不修改
 OPENCV_DIR=$(pwd)/deps/opencv

+ 0 - 11
deploy/raspberry/scripts/install_third-party.sh

@@ -11,17 +11,6 @@ if [ ! -d "./deps/gflag" ]; then
     cd ..
     cd ..
 fi
-if [ ! -d "./deps/glog" ]; then
-    cd deps
-    git clone https://github.com/google/glog
-    sudo apt-get install autoconf automake libtool
-    cd glog
-    ./autogen.sh
-    ./configure
-    make -j 4
-    cd ..
-    cd ..
-fi
 OPENCV_URL=https://bj.bcebos.com/paddlex/deploy/armlinux/opencv.tar.bz2
 if [ ! -d "./deps/opencv" ]; then
     cd deps

+ 0 - 4
docs/deploy/openvino/linux.md

@@ -33,8 +33,6 @@ git clone https://github.com/PaddlePaddle/PaddleX.git
 
 - gflags:编译请参考 [编译文档](https://gflags.github.io/gflags/#download)  
 
-- glog:编译请参考[编译文档](https://github.com/google/glog)
-
 - opencv: 编译请参考
 [编译文档](https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html)
 
@@ -47,8 +45,6 @@ git clone https://github.com/PaddlePaddle/PaddleX.git
 OPENVINO_DIR=$INTEL_OPENVINO_DIR/inference_engine
 # gflags预编译库的路径
 GFLAGS_DIR=$(pwd)/deps/gflags
-# glog预编译库的路径
-GLOG_DIR=$(pwd)/deps/glog
 # ngraph lib预编译库的路径
 NGRAPH_LIB=$INTEL_OPENVINO_DIR/deployment_tools/ngraph/lib
 # opencv预编译库的路径

+ 2 - 4
docs/deploy/openvino/windows.md

@@ -40,11 +40,10 @@ git clone https://github.com/PaddlePaddle/PaddleX.git
 
 ### Step2 软件依赖
 提供了依赖软件预编译库:
-- [gflas-glog](https://bj.bcebos.com/paddlex/deploy/windows/third-parts.zip)  
+- [gflas](https://bj.bcebos.com/paddlex/deploy/windows/third-parts.zip)  
 - [opencv](https://bj.bcebos.com/paddleseg/deploy/opencv-3.4.6-vc14_vc15.exe)  
 请下载上面两个连接的预编译库。若需要自行下载请参考:
 - gflags:[下载地址](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/gflags)
-- glog:[编译文档](https://github.com/google/glog)
 - opencv:[下载地址](https://opencv.org/releases/)  
 下载完opencv后需要配置环境变量,如下流程所示  
     - 我的电脑->属性->高级系统设置->环境变量
@@ -55,7 +54,7 @@ git clone https://github.com/PaddlePaddle/PaddleX.git
 1. 打开Visual Studio 2019 Community,点击`继续但无需代码`
 2. 点击: `文件`->`打开`->`CMake` 选择C++预测代码所在路径(例如`D:\projects\PaddleX\deploy\openvino`),并打开`CMakeList.txt`  
 3. 点击:`项目`->`CMake设置`
-4. 点击`浏览`,分别设置编译选项指定`OpenVINO`、`Gflags`、`GLOG`、`NGRAPH`、`OPENCV`的路径  
+4. 点击`浏览`,分别设置编译选项指定`OpenVINO`、`Gflags`、`NGRAPH`、`OPENCV`的路径  
 
 |  参数名   | 含义  |
 |  ----  | ----  |
@@ -63,7 +62,6 @@ git clone https://github.com/PaddlePaddle/PaddleX.git
 | OPENVINO_DIR | OpenVINO推理库路径,在OpenVINO安装目录下的deployment/inference_engine目录,若未修改OpenVINO默认安装目录可以不用修改 |
 | NGRAPH_LIB | OpenVINO的ngraph库路径,在OpenVINO安装目录下的deployment/ngraph/lib目录,若未修改OpenVINO默认安装目录可以不用修改 |
 | GFLAGS_DIR | gflags库路径 |
-| GLOG_DIR  | glog库路径 |
 | WITH_STATIC_LIB | 是否静态编译,默认为True |  
 
 **设置完成后**, 点击`保存并生成CMake缓存以加载变量`。