未验证 提交 f708d425 编写于 作者: G Guanghua Yu 提交者: GitHub

[Cherry pick]fix bugs of cpp deploy in windows (#748)

* fix cpp deploy in windows
上级 a3bf27da
...@@ -9,6 +9,7 @@ option(WITH_TENSORRT "Compile demo with TensorRT." OFF) ...@@ -9,6 +9,7 @@ option(WITH_TENSORRT "Compile demo with TensorRT." OFF)
SET(PADDLE_DIR "" CACHE PATH "Location of libraries") SET(PADDLE_DIR "" CACHE PATH "Location of libraries")
SET(OPENCV_DIR "" CACHE PATH "Location of libraries") SET(OPENCV_DIR "" CACHE PATH "Location of libraries")
SET(CUDA_LIB "" CACHE PATH "Location of libraries") SET(CUDA_LIB "" CACHE PATH "Location of libraries")
SET(CUDNN_LIB "" CACHE PATH "Location of libraries")
SET(TENSORRT_DIR "" CACHE PATH "Compile demo with TensorRT") SET(TENSORRT_DIR "" CACHE PATH "Compile demo with TensorRT")
include(cmake/yaml-cpp.cmake) include(cmake/yaml-cpp.cmake)
...@@ -51,7 +52,6 @@ endif() ...@@ -51,7 +52,6 @@ endif()
if(EXISTS "${PADDLE_DIR}/third_party/install/snappystream/include") if(EXISTS "${PADDLE_DIR}/third_party/install/snappystream/include")
include_directories("${PADDLE_DIR}/third_party/install/snappystream/include") include_directories("${PADDLE_DIR}/third_party/install/snappystream/include")
endif() endif()
include_directories("${PADDLE_DIR}/third_party/install/zlib/include")
include_directories("${PADDLE_DIR}/third_party/boost") include_directories("${PADDLE_DIR}/third_party/boost")
include_directories("${PADDLE_DIR}/third_party/eigen3") include_directories("${PADDLE_DIR}/third_party/eigen3")
...@@ -62,7 +62,6 @@ if(EXISTS "${PADDLE_DIR}/third_party/install/snappystream/lib") ...@@ -62,7 +62,6 @@ if(EXISTS "${PADDLE_DIR}/third_party/install/snappystream/lib")
link_directories("${PADDLE_DIR}/third_party/install/snappystream/lib") link_directories("${PADDLE_DIR}/third_party/install/snappystream/lib")
endif() endif()
link_directories("${PADDLE_DIR}/third_party/install/zlib/lib")
link_directories("${PADDLE_DIR}/third_party/install/protobuf/lib") link_directories("${PADDLE_DIR}/third_party/install/protobuf/lib")
link_directories("${PADDLE_DIR}/third_party/install/glog/lib") link_directories("${PADDLE_DIR}/third_party/install/glog/lib")
link_directories("${PADDLE_DIR}/third_party/install/gflags/lib") link_directories("${PADDLE_DIR}/third_party/install/gflags/lib")
...@@ -183,7 +182,7 @@ if (NOT WIN32) ...@@ -183,7 +182,7 @@ if (NOT WIN32)
else() else()
set(DEPS ${DEPS} set(DEPS ${DEPS}
${MATH_LIB} ${MKLDNN_LIB} ${MATH_LIB} ${MKLDNN_LIB}
glog gflags_static libprotobuf zlibstatic xxhash libyaml-cppmt) glog gflags_static libprotobuf xxhash libyaml-cppmt)
set(DEPS ${DEPS} libcmt shlwapi) set(DEPS ${DEPS} libcmt shlwapi)
if (EXISTS "${PADDLE_DIR}/third_party/install/snappy/lib") if (EXISTS "${PADDLE_DIR}/third_party/install/snappy/lib")
set(DEPS ${DEPS} snappy) set(DEPS ${DEPS} snappy)
......
...@@ -106,7 +106,7 @@ make ...@@ -106,7 +106,7 @@ make
./build/main --model_dir=/root/projects/models/yolov3_darknet --image_path=/root/projects/images/test.jpeg ./build/main --model_dir=/root/projects/models/yolov3_darknet --image_path=/root/projects/images/test.jpeg
``` ```
图片文件`可视化预测结果`会保存在当前目录下`result.jpeg`文件中。 图片文件`可视化预测结果`会保存在当前目录下`output.jpeg`文件中。
`样例二`: `样例二`:
...@@ -114,4 +114,4 @@ make ...@@ -114,4 +114,4 @@ make
#使用 `GPU`预测视频`/root/projects/videos/test.avi` #使用 `GPU`预测视频`/root/projects/videos/test.avi`
./build/main --model_dir=/root/projects/models/yolov3_darknet --video_path=/root/projects/images/test.avi --use_gpu=1 ./build/main --model_dir=/root/projects/models/yolov3_darknet --video_path=/root/projects/images/test.avi --use_gpu=1
``` ```
视频文件`可视化预测结果`会保存在当前目录下`result.avi`文件中。 视频文件`可视化预测结果`会保存在当前目录下`output.avi`文件中。
...@@ -67,6 +67,7 @@ fluid_inference ...@@ -67,6 +67,7 @@ fluid_inference
| 参数名 | 含义 | | 参数名 | 含义 |
| ---- | ---- | | ---- | ---- |
| *CUDA_LIB | CUDA的库路径 | | *CUDA_LIB | CUDA的库路径 |
| CUDNN_LIB | CUDNN的库路径 |
| OPENCV_DIR | OpenCV的安装路径, | | OPENCV_DIR | OpenCV的安装路径, |
| PADDLE_DIR | Paddle预测库的路径 | | PADDLE_DIR | Paddle预测库的路径 |
...@@ -85,7 +86,7 @@ fluid_inference ...@@ -85,7 +86,7 @@ fluid_inference
上述`Visual Studio 2019`编译产出的可执行文件在`out\build\x64-Release`目录下,打开`cmd`,并切换到该目录: 上述`Visual Studio 2019`编译产出的可执行文件在`out\build\x64-Release`目录下,打开`cmd`,并切换到该目录:
``` ```
cd D:\projects\PaddleDetection\inference\out\build\x64-Release cd D:\projects\PaddleDetection\deploy\cpp\out\build\x64-Release
``` ```
可执行文件`main`即为样例的预测程序,其主要的命令行参数如下: 可执行文件`main`即为样例的预测程序,其主要的命令行参数如下:
...@@ -105,7 +106,7 @@ cd D:\projects\PaddleDetection\inference\out\build\x64-Release ...@@ -105,7 +106,7 @@ cd D:\projects\PaddleDetection\inference\out\build\x64-Release
.\main --model_dir=D:\\models\\yolov3_darknet --image_path=D:\\images\\test.jpeg .\main --model_dir=D:\\models\\yolov3_darknet --image_path=D:\\images\\test.jpeg
``` ```
图片文件`可视化预测结果`会保存在当前目录下`result.jpeg`文件中。 图片文件`可视化预测结果`会保存在当前目录下`output.jpeg`文件中。
`样例二`: `样例二`:
...@@ -114,4 +115,4 @@ cd D:\projects\PaddleDetection\inference\out\build\x64-Release ...@@ -114,4 +115,4 @@ cd D:\projects\PaddleDetection\inference\out\build\x64-Release
.\main --model_dir=D:\\models\\yolov3_darknet --video_path=D:\\videos\\test.jpeg --use_gpu=1 .\main --model_dir=D:\\models\\yolov3_darknet --video_path=D:\\videos\\test.jpeg --use_gpu=1
``` ```
视频文件`可视化预测结果`会保存在当前目录下`result.avi`文件中。 视频文件`可视化预测结果`会保存在当前目录下`output.avi`文件中。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册