diff --git a/contrib/RealTimeHumanSeg/CMakeLists.txt b/contrib/RealTimeHumanSeg/CMakeLists.txt index 992b6d1d9d8ae2c801b27bfda33ab2d89bf0d147..5a7b89acc41da5576a0f0ead7205385feabf5dab 100644 --- a/contrib/RealTimeHumanSeg/CMakeLists.txt +++ b/contrib/RealTimeHumanSeg/CMakeLists.txt @@ -70,10 +70,10 @@ if (WIN32) include_directories("${OPENCV_DIR}/opencv/build/include") link_directories("${OPENCV_DIR}/build/x64/vc14/lib") else () + find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/share/OpenCV NO_DEFAULT_PATH) include_directories("${PADDLE_DIR}/paddle/include") link_directories("${PADDLE_DIR}/paddle/lib") - include_directories("${OPENCV_DIR}/include") - link_directories("${OPENCV_DIR}/lib") + include_directories(${OpenCV_INCLUDE_DIRS}) endif () if (WIN32) @@ -202,12 +202,8 @@ if(WITH_GPU) endif() if (NOT WIN32) - set(EXTERNAL_LIB "-ldl -lrt -lgomp -lz -lm -lpthread" - "-lopencv_world -lopencv_img_hash" - "-lIlmImf -llibpng -lippiw -lippicv" - "-llibtiff -llibwebp -littnotify -llibjasper" - "-llibjpeg -lzlib") - set(DEPS ${DEPS} ${EXTERNAL_LIB}) + set(EXTERNAL_LIB "-ldl -lrt -lgomp -lz -lm -lpthread") + set(DEPS ${DEPS} ${EXTERNAL_LIB} ${OpenCV_LIBS}) endif() add_executable(main main.cc humanseg.cc humanseg_postprocess.cc) diff --git a/contrib/RealTimeHumanSeg/data/test.avi b/contrib/RealTimeHumanSeg/data/test.avi deleted file mode 100644 index 8e2db05b4e7ed0e54af72329ca4899e3641bb560..0000000000000000000000000000000000000000 Binary files a/contrib/RealTimeHumanSeg/data/test.avi and /dev/null differ diff --git a/contrib/RealTimeHumanSeg/docs/linux_build.md b/contrib/RealTimeHumanSeg/docs/linux_build.md index ecc74de742988bcafaf60faaf5916d409ca833f4..823ff3ae7cc6b16d9f5696924ae5def746bc8892 100644 --- a/contrib/RealTimeHumanSeg/docs/linux_build.md +++ b/contrib/RealTimeHumanSeg/docs/linux_build.md @@ -81,4 +81,6 @@ sh linux_build.sh ./build/main ./models /PATH/TO/TEST_VIDEO ``` +点击下载[测试视频](https://paddleseg.bj.bcebos.com/deploy/data/test.avi) + 预测的结果保存在视频文件`result.avi`中。 diff --git a/contrib/RealTimeHumanSeg/docs/windows_build.md b/contrib/RealTimeHumanSeg/docs/windows_build.md index 89b28a3fdc8e95b9c78fbb2a358a74c6e6f261e0..6937dbcff4f55c5a085aa9d0bd2674c04f3ac8e5 100644 --- a/contrib/RealTimeHumanSeg/docs/windows_build.md +++ b/contrib/RealTimeHumanSeg/docs/windows_build.md @@ -78,4 +78,6 @@ main.exe ./models/ ./data/test.avi ``` 第一个参数即人像分割预测模型的路径,第二个参数即要预测的视频。 +点击下载[测试视频](https://paddleseg.bj.bcebos.com/deploy/data/test.avi) + 运行后,预测结果保存在文件`result.avi`中。 diff --git a/contrib/RealTimeHumanSeg/linux_build.sh b/contrib/RealTimeHumanSeg/linux_build.sh index a0382fb9330fcd74bd719640313faba51e0019ca..ff0b11bcf60f1b4ec4d7a9f63f7490ffb70ad6e0 100644 --- a/contrib/RealTimeHumanSeg/linux_build.sh +++ b/contrib/RealTimeHumanSeg/linux_build.sh @@ -1,10 +1,10 @@ -OPENCV_URL=https://paddleseg.bj.bcebos.com/deploy/deps/opencv341.tar.bz2 -if [ ! -d "./deps/opencv341" ]; then +OPENCV_URL=https://paddleseg.bj.bcebos.com/deploy/deps/opencv346.tar.bz2 +if [ ! -d "./deps/opencv346" ]; then mkdir -p deps cd deps wget -c ${OPENCV_URL} - tar xvfj opencv341.tar.bz2 - rm -rf opencv341.tar.bz2 + tar xvfj opencv346.tar.bz2 + rm -rf opencv346.tar.bz2 cd .. fi @@ -12,7 +12,8 @@ WITH_GPU=OFF PADDLE_DIR=/root/projects/deps/fluid_inference/ CUDA_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 mkdir -p build