PaddlePaddle / FastDeploy

⚡️An Easy-to-use and Fast Deep Learning Model Deployment Toolkit for ☁️Cloud 📱Mobile and 📹Edge. Including Image, Video, Text and Audio 20+ main stream scenarios and 150+ SOTA models with end-to-end optimization, multi-platform and multi-framework support.
https://www.paddlepaddle.org.cn/fastdeploy
Apache License 2.0
2.99k stars 465 forks source link

rk3568运行目标检测时想用系统的opencv #1789

Closed LiangYongAI closed 6 months ago

LiangYongAI commented 1 year ago

Environment

FastDeploy version: the latest code in develop branch OS Platform: e.g. Linux x64 arm Hardware: 3568 Program Language:c

Problem description

我现在应用要用到opencv读取图像后用imshow显示,但提示报错,查了下,opencv是用的fastdeploy里面自带的第三方库,估计是编译时候什么开关没有打开,于是我改了cmake后,用自己系统安装的opencv,在log里可以看到opencv的路径是/usr/local,编译也是成功的,但在运行时为什么还是找的fastdeploy里面自带的第三方opencv?

请问如果何才能用系统里面的opencv?

log如下: root@localhost:/opt/FastDeploy-develop/examples/vision/detection/paddledetection/rknpu2/cpp/build# make -- The path of RKNPU2 is /opt/fastdeploy-0.0.0/third_libs/install/rknpu2_runtime/lib/librknnrt.so. -- The path of OpenCV is /usr/local. -- Found OpenCV: /usr/local (found version "4.5.1") -- -- *****FastDeploy Building Summary** -- CMake version : 3.16.3 -- CMake command : /usr/bin/cmake -- System : Linux -- C++ compiler : /usr/bin/c++ -- C++ compiler version : 9.4.0 -- CXX flags : -Wno-format -- EXE linker flags : -- Shared linker flags : -- Build type : -- Compile definitions : _GLIBCXX_USE_CXX11_ABI=1 -- CMAKE_PREFIX_PATH : -- CMAKE_INSTALL_PREFIX : /usr/local -- CMAKE_MODULE_PATH : -- -- FastDeploy version : 0.0.0 -- ENABLE_ORT_BACKEND : OFF -- ENABLE_RKNPU2_BACKEND : ON -- ENABLE_SOPHGO_BACKEND : OFF -- ENABLE_PADDLE_BACKEND : OFF -- ENABLE_LITE_BACKEND : OFF -- ENABLE_POROS_BACKEND : OFF -- ENABLE_TRT_BACKEND : OFF -- ENABLE_OPENVINO_BACKEND : OFF -- ENABLE_BENCHMARK : OFF -- ENABLE_VISION : ON -- ENABLE_TEXT : OFF -- ENABLE_ENCRYPTION : OFF -- ENABLE_FLYCV : OFF -- ENABLE_CVCUDA : OFF -- WITH_GPU : OFF -- WITH_IPU : OFF -- WITH_TESTING : OFF -- WITH_ASCEND : OFF -- WITH_DIRECTML : OFF -- WITH_TIMVX : OFF -- WITH_KUNLUNXIN : OFF -- WITH_CAPI : OFF -- WITH_CSHARPAPI : OFF -- DEPENDENCY_LIBS : /opt/fastdeploy-0.0.0/lib/libfastdeploy.so;/opt/fastdeploy-0.0.0/third_libs/install/rknpu2_runtime/lib/librknnrt.so;opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui

root@localhost:/opt/FastDeploy-develop/examples/vision/detection/paddledetection/rknpu2/cpp/build# ./infer_picodet_demo me.jpg 1 ./infer_picodet_demo: error while loading shared libraries: libopencv_video.so.406: cannot open shared object file: No such file or directory

DefTruth commented 1 year ago

可以参考这篇文档,指定你本地的opencv:

Zheng-Bicheng commented 1 year ago

检查下环境变量有没有配置,需要你重新执行下配置环境变量的操作

Zheng-Bicheng commented 1 year ago

可以用ldd 编译出来的程序命令看一下是否链接到了你想要的opencv动态库