提交 ad9da388 编写于 作者: S sjtubinlong

update build script and fix bugs

上级 584ad688
...@@ -70,10 +70,10 @@ if (WIN32) ...@@ -70,10 +70,10 @@ if (WIN32)
include_directories("${OPENCV_DIR}/opencv/build/include") include_directories("${OPENCV_DIR}/opencv/build/include")
link_directories("${OPENCV_DIR}/build/x64/vc14/lib") link_directories("${OPENCV_DIR}/build/x64/vc14/lib")
else () else ()
find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/share/OpenCV NO_DEFAULT_PATH)
include_directories("${PADDLE_DIR}/paddle/include") include_directories("${PADDLE_DIR}/paddle/include")
link_directories("${PADDLE_DIR}/paddle/lib") link_directories("${PADDLE_DIR}/paddle/lib")
include_directories("${OPENCV_DIR}/include") include_directories(${OpenCV_INCLUDE_DIRS})
link_directories("${OPENCV_DIR}/lib")
endif () endif ()
if (WIN32) if (WIN32)
...@@ -202,12 +202,8 @@ if(WITH_GPU) ...@@ -202,12 +202,8 @@ if(WITH_GPU)
endif() endif()
if (NOT WIN32) if (NOT WIN32)
set(EXTERNAL_LIB "-ldl -lrt -lgomp -lz -lm -lpthread" set(EXTERNAL_LIB "-ldl -lrt -lgomp -lz -lm -lpthread")
"-lopencv_world -lopencv_img_hash" set(DEPS ${DEPS} ${EXTERNAL_LIB} ${OpenCV_LIBS})
"-lIlmImf -llibpng -lippiw -lippicv"
"-llibtiff -llibwebp -littnotify -llibjasper"
"-llibjpeg -lzlib")
set(DEPS ${DEPS} ${EXTERNAL_LIB})
endif() endif()
add_executable(main main.cc humanseg.cc humanseg_postprocess.cc) add_executable(main main.cc humanseg.cc humanseg_postprocess.cc)
......
...@@ -81,4 +81,6 @@ sh linux_build.sh ...@@ -81,4 +81,6 @@ sh linux_build.sh
./build/main ./models /PATH/TO/TEST_VIDEO ./build/main ./models /PATH/TO/TEST_VIDEO
``` ```
点击下载[测试视频](https://paddleseg.bj.bcebos.com/deploy/data/test.avi)
预测的结果保存在视频文件`result.avi`中。 预测的结果保存在视频文件`result.avi`中。
...@@ -78,4 +78,6 @@ main.exe ./models/ ./data/test.avi ...@@ -78,4 +78,6 @@ main.exe ./models/ ./data/test.avi
``` ```
第一个参数即人像分割预测模型的路径,第二个参数即要预测的视频。 第一个参数即人像分割预测模型的路径,第二个参数即要预测的视频。
点击下载[测试视频](https://paddleseg.bj.bcebos.com/deploy/data/test.avi)
运行后,预测结果保存在文件`result.avi`中。 运行后,预测结果保存在文件`result.avi`中。
OPENCV_URL=https://paddleseg.bj.bcebos.com/deploy/deps/opencv341.tar.bz2 OPENCV_URL=https://paddleseg.bj.bcebos.com/deploy/deps/opencv346.tar.bz2
if [ ! -d "./deps/opencv341" ]; then if [ ! -d "./deps/opencv346" ]; then
mkdir -p deps mkdir -p deps
cd deps cd deps
wget -c ${OPENCV_URL} wget -c ${OPENCV_URL}
tar xvfj opencv341.tar.bz2 tar xvfj opencv346.tar.bz2
rm -rf opencv341.tar.bz2 rm -rf opencv346.tar.bz2
cd .. cd ..
fi fi
...@@ -12,7 +12,8 @@ WITH_GPU=OFF ...@@ -12,7 +12,8 @@ WITH_GPU=OFF
PADDLE_DIR=/root/projects/deps/fluid_inference/ PADDLE_DIR=/root/projects/deps/fluid_inference/
CUDA_LIB=/usr/local/cuda-10.0/lib64/ CUDA_LIB=/usr/local/cuda-10.0/lib64/
CUDNN_LIB=/usr/local/cuda-10.0/lib64/ CUDNN_LIB=/usr/local/cuda-10.0/lib64/
OPENCV_DIR=$(pwd)/deps/opencv341/ OPENCV_DIR=$(pwd)/deps/opencv346/
echo ${OPENCV_DIR}
rm -rf build rm -rf build
mkdir -p build mkdir -p build
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册