From 1e9872db94fd309eff8210a67ffcff6e3bc5ebda Mon Sep 17 00:00:00 2001 From: yeliang2258 <30516196+yeliang2258@users.noreply.github.com> Date: Wed, 21 Dec 2022 20:00:43 +0800 Subject: [PATCH] [Other] Add FlyCV support for A311D (#928) * add FlyCV support * update doc * update cmake * re-ci * fix bug * fix cmake * fix doc * update doc * fix doc --- cmake/flycv.cmake | 10 +++++++--- docs/cn/build_and_install/a311d.md | 7 ++++--- docs/cn/build_and_install/rv1126.md | 6 +++--- docs/en/build_and_install/a311d.md | 7 ++++--- docs/en/build_and_install/rv1126.md | 6 +++--- .../paddleclas/a311d/cpp/CMakeLists.txt | 16 ++++------------ .../paddleclas/a311d/cpp/README.md | 6 ++++-- .../classification/paddleclas/a311d/cpp/infer.cc | 2 +- .../paddleclas/rv1126/cpp/README.md | 6 ++++-- .../paddledetection/a311d/cpp/CMakeLists.txt | 16 ++++------------ .../paddledetection/a311d/cpp/README.md | 6 ++++-- .../paddledetection/a311d/cpp/infer_ppyoloe.cc | 2 +- .../paddledetection/rv1126/cpp/README.md | 6 ++++-- .../detection/yolov5/a311d/cpp/CMakeLists.txt | 15 ++++----------- .../vision/detection/yolov5/a311d/cpp/README.md | 6 ++++-- .../vision/detection/yolov5/a311d/cpp/infer.cc | 2 +- .../vision/detection/yolov5/rv1126/cpp/README.md | 6 ++++-- .../paddleseg/a311d/cpp/CMakeLists.txt | 16 ++++------------ .../segmentation/paddleseg/a311d/cpp/README.md | 6 ++++-- .../segmentation/paddleseg/a311d/cpp/infer.cc | 2 +- .../segmentation/paddleseg/rv1126/cpp/README.md | 4 ++-- 21 files changed, 71 insertions(+), 82 deletions(-) mode change 100644 => 100755 cmake/flycv.cmake diff --git a/cmake/flycv.cmake b/cmake/flycv.cmake old mode 100644 new mode 100755 index b2cb1f448..155a6356b --- a/cmake/flycv.cmake +++ b/cmake/flycv.cmake @@ -65,6 +65,7 @@ endif(WIN32) set(FLYCV_URL_BASE "https://bj.bcebos.com/fastdeploy/third_libs/") set(FLYCV_VERSION "1.0.0") + if(WIN32) message(FATAL_ERROR "FlyCV is not supported on Windows now.") set(FLYCV_FILE "flycv-win-x64-${FLYCV_VERSION}.zip") @@ -78,11 +79,14 @@ elseif(APPLE) elseif(ANDROID) set(FLYCV_FILE "flycv-android-${FLYCV_VERSION}.tgz") else() - if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64") set(FLYCV_FILE "flycv-linux-aarch64-${FLYCV_VERSION}.tgz") else() - message(FATAL_ERROR "FlyCV is not supported on Linux x64 now.") - set(FLYCV_FILE "flycv-linux-x64-${FLYCV_VERSION}.tgz") + if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + set(FLYCV_FILE "flycv-linux-aarch64-${FLYCV_VERSION}.tgz") + else() + message(FATAL_ERROR "FlyCV is not supported on Linux x64 now.") + endif() endif() endif() set(FLYCV_URL "${FLYCV_URL_BASE}${FLYCV_FILE}") diff --git a/docs/cn/build_and_install/a311d.md b/docs/cn/build_and_install/a311d.md index 7222ea085..6ce7dfe94 100755 --- a/docs/cn/build_and_install/a311d.md +++ b/docs/cn/build_and_install/a311d.md @@ -16,7 +16,7 @@ FastDeploy 基于 Paddle Lite 后端支持在晶晨 NPU 上进行部署推理。 ## 交叉编译环境搭建 -### 宿主机环境需求 +### 开发机环境需求 - os:Ubuntu == 16.04 - cmake: version >= 3.10.0 @@ -59,7 +59,8 @@ mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=./../cmake/toolchain.cmake \ -DWITH_TIMVX=ON \ -DTARGET_ABI=arm64 \ - -DCMAKE_INSTALL_PREFIX=fastdeploy-tmivx \ + -DENABLE_FLYCV=ON \ # 是否开启 FlyCV 优化前后处理,可以选择开启 + -DCMAKE_INSTALL_PREFIX=fastdeploy-timvx \ -DENABLE_VISION=ON \ # 是否编译集成视觉模型的部署模块,可选择开启 -Wno-dev .. @@ -67,7 +68,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=./../cmake/toolchain.cmake \ make -j8 make install ``` -编译完成之后,会生成 fastdeploy-tmivx 目录,表示基于 Paddle Lite TIM-VX 的 FastDeploy 库编译完成。 +编译完成之后,会生成 fastdeploy-timvx 目录,表示基于 Paddle Lite TIM-VX 的 FastDeploy 库编译完成。 ## 准备设备运行环境 部署前要保证晶晨 Linux Kernel NPU 驱动 galcore.so 版本及所适用的芯片型号与依赖库保持一致,在部署前,请登录开发板,并通过命令行输入以下命令查询 NPU 驱动版本,晶晨建议的驱动版本为:6.4.4.3 diff --git a/docs/cn/build_and_install/rv1126.md b/docs/cn/build_and_install/rv1126.md index 40136129e..e6d8091c7 100755 --- a/docs/cn/build_and_install/rv1126.md +++ b/docs/cn/build_and_install/rv1126.md @@ -16,7 +16,7 @@ FastDeploy基于 Paddle Lite 后端支持在瑞芯微(Rockchip)Soc 上进行 ## 交叉编译环境搭建 -### 宿主机环境需求 +### 开发机环境需求 - os:Ubuntu == 16.04 - cmake: version >= 3.10.0 @@ -59,7 +59,7 @@ mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=./../cmake/toolchain.cmake \ -DWITH_TIMVX=ON \ -DTARGET_ABI=armhf \ - -DCMAKE_INSTALL_PREFIX=fastdeploy-tmivx \ + -DCMAKE_INSTALL_PREFIX=fastdeploy-timvx \ -DENABLE_VISION=ON \ # 是否编译集成视觉模型的部署模块,可选择开启 -Wno-dev .. @@ -67,7 +67,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=./../cmake/toolchain.cmake \ make -j8 make install ``` -编译完成之后,会生成 fastdeploy-tmivx 目录,表示基于 Paddle Lite TIM-VX 的 FastDeploy 库编译完成。 +编译完成之后,会生成 fastdeploy-timvx 目录,表示基于 Paddle Lite TIM-VX 的 FastDeploy 库编译完成。 ## 准备设备运行环境 部署前要保证芯原 Linux Kernel NPU 驱动 galcore.so 版本及所适用的芯片型号与依赖库保持一致,在部署前,请登录开发板,并通过命令行输入以下命令查询 NPU 驱动版本,Rockchip建议的驱动版本为: 6.4.6.5 diff --git a/docs/en/build_and_install/a311d.md b/docs/en/build_and_install/a311d.md index 183db152d..da9ec2a96 100755 --- a/docs/en/build_and_install/a311d.md +++ b/docs/en/build_and_install/a311d.md @@ -58,15 +58,16 @@ mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=./../cmake/toolchain.cmake \ -DWITH_TIMVX=ON \ -DTARGET_ABI=arm64 \ - -DCMAKE_INSTALL_PREFIX=fastdeploy-tmivx \ - -DENABLE_VISION=ON \ # 是否编译集成视觉模型的部署模块,可选择开启 + -DENABLE_FLYCV=ON \ # Whether to enable FlyCV optimization + -DCMAKE_INSTALL_PREFIX=fastdeploy-timvx \ + -DENABLE_VISION=ON \ # Whether to compile the vision module -Wno-dev .. # Build FastDeploy A311D C++ SDK make -j8 make install ``` -After the compilation is complete, the fastdeploy-tmivx directory will be generated, indicating that the FastDeploy library based on Paddle Lite TIM-VX has been compiled. +After the compilation is complete, the fastdeploy-timvx directory will be generated, indicating that the FastDeploy library based on Paddle Lite TIM-VX has been compiled. ## Prepare the Soc environment Before deployment, ensure that the version of the driver galcore.so of the Verisilicon Linux Kernel NPU meets the requirements. Before deployment, please log in to the development board, and enter the following command through the command line to query the NPU driver version. The recommended version of the Rockchip driver is: 6.4.4.3 diff --git a/docs/en/build_and_install/rv1126.md b/docs/en/build_and_install/rv1126.md index 1cc163b09..0a7eebacb 100755 --- a/docs/en/build_and_install/rv1126.md +++ b/docs/en/build_and_install/rv1126.md @@ -58,15 +58,15 @@ mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=./../cmake/toolchain.cmake \ -DWITH_TIMVX=ON \ -DTARGET_ABI=armhf \ - -DCMAKE_INSTALL_PREFIX=fastdeploy-tmivx \ - -DENABLE_VISION=ON \ # 是否编译集成视觉模型的部署模块,可选择开启 + -DCMAKE_INSTALL_PREFIX=fastdeploy-timvx \ + -DENABLE_VISION=ON \ # Whether to compile the vision module -Wno-dev .. # Build FastDeploy RV1126 C++ SDK make -j8 make install ``` -After the compilation is complete, the fastdeploy-tmivx directory will be generated, indicating that the FastDeploy library based on Paddle Lite TIM-VX has been compiled. +After the compilation is complete, the fastdeploy-timvx directory will be generated, indicating that the FastDeploy library based on Paddle Lite TIM-VX has been compiled. ## Prepare the Soc environment Before deployment, ensure that the version of the driver galcore.so of the Verisilicon Linux Kernel NPU meets the requirements. Before deployment, please log in to the development board, and enter the following command through the command line to query the NPU driver version. The recommended version of the Rockchip driver is: 6.4.6.5 diff --git a/examples/vision/classification/paddleclas/a311d/cpp/CMakeLists.txt b/examples/vision/classification/paddleclas/a311d/cpp/CMakeLists.txt index baaf8331f..64b7a6466 100755 --- a/examples/vision/classification/paddleclas/a311d/cpp/CMakeLists.txt +++ b/examples/vision/classification/paddleclas/a311d/cpp/CMakeLists.txt @@ -20,19 +20,11 @@ install(TARGETS infer_demo DESTINATION ./) install(DIRECTORY models DESTINATION ./) install(DIRECTORY images DESTINATION ./) -# install(DIRECTORY run_with_adb.sh DESTINATION ./) -file(GLOB FASTDEPLOY_LIBS ${FASTDEPLOY_INSTALL_DIR}/lib/*) -install(PROGRAMS ${FASTDEPLOY_LIBS} DESTINATION lib) - -file(GLOB OPENCV_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/opencv/lib/lib*) -install(PROGRAMS ${OPENCV_LIBS} DESTINATION lib) - -file(GLOB PADDLELITE_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddlelite/lib/lib*) -install(PROGRAMS ${PADDLELITE_LIBS} DESTINATION lib) - -file(GLOB TIMVX_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddlelite/lib/verisilicon_timvx/*) -install(PROGRAMS ${TIMVX_LIBS} DESTINATION lib) +file(GLOB_RECURSE FASTDEPLOY_LIBS ${FASTDEPLOY_INSTALL_DIR}/lib/lib*.so*) +file(GLOB_RECURSE ALL_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/lib*.so*) +list(APPEND ALL_LIBS ${FASTDEPLOY_LIBS}) +install(PROGRAMS ${ALL_LIBS} DESTINATION lib) file(GLOB ADB_TOOLS run_with_adb.sh) install(PROGRAMS ${ADB_TOOLS} DESTINATION ./) diff --git a/examples/vision/classification/paddleclas/a311d/cpp/README.md b/examples/vision/classification/paddleclas/a311d/cpp/README.md index c33021fe8..11279ccb0 100755 --- a/examples/vision/classification/paddleclas/a311d/cpp/README.md +++ b/examples/vision/classification/paddleclas/a311d/cpp/README.md @@ -16,11 +16,12 @@ 2. 将编译后的库拷贝到当前目录,可使用如下命令: ```bash -cp -r FastDeploy/build/fastdeploy-tmivx/ FastDeploy/examples/vision/classification/paddleclas/a311d/cpp/ +cp -r FastDeploy/build/fastdeploy-timvx/ FastDeploy/examples/vision/classification/paddleclas/a311d/cpp/ ``` 3. 在当前路径下载部署所需的模型和示例图片: ```bash +cd FastDeploy/examples/vision/classification/paddleclas/a311d/cpp/ mkdir models && mkdir images wget https://bj.bcebos.com/paddlehub/fastdeploy/resnet50_vd_ptq.tar tar -xvf resnet50_vd_ptq.tar @@ -31,8 +32,9 @@ cp -r ILSVRC2012_val_00000010.jpeg images 4. 编译部署示例,可使入如下命令: ```bash +cd FastDeploy/examples/vision/classification/paddleclas/a311d/cpp/ mkdir build && cd build -cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-tmivx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-tmivx -DTARGET_ABI=arm64 .. +cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-timvx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-timvx -DTARGET_ABI=arm64 .. make -j8 make install # 成功编译之后,会生成 install 文件夹,里面有一个运行 demo 和部署所需的库 diff --git a/examples/vision/classification/paddleclas/a311d/cpp/infer.cc b/examples/vision/classification/paddleclas/a311d/cpp/infer.cc index 140311eec..b1b6f435b 100755 --- a/examples/vision/classification/paddleclas/a311d/cpp/infer.cc +++ b/examples/vision/classification/paddleclas/a311d/cpp/infer.cc @@ -23,7 +23,7 @@ void InitAndInfer(const std::string& model_dir, const std::string& image_file) { auto model_file = model_dir + sep + "inference.pdmodel"; auto params_file = model_dir + sep + "inference.pdiparams"; auto config_file = model_dir + sep + "inference_cls.yaml"; - + fastdeploy::vision::EnableFlyCV(); fastdeploy::RuntimeOption option; option.UseTimVX(); diff --git a/examples/vision/classification/paddleclas/rv1126/cpp/README.md b/examples/vision/classification/paddleclas/rv1126/cpp/README.md index 6379eba54..b0e4623a7 100755 --- a/examples/vision/classification/paddleclas/rv1126/cpp/README.md +++ b/examples/vision/classification/paddleclas/rv1126/cpp/README.md @@ -16,11 +16,12 @@ 2. 将编译后的库拷贝到当前目录,可使用如下命令: ```bash -cp -r FastDeploy/build/fastdeploy-tmivx/ FastDeploy/examples/vision/classification/paddleclas/rv1126/cpp/ +cp -r FastDeploy/build/fastdeploy-timvx/ FastDeploy/examples/vision/classification/paddleclas/rv1126/cpp/ ``` 3. 在当前路径下载部署所需的模型和示例图片: ```bash +cd FastDeploy/examples/vision/classification/paddleclas/rv1126/cpp/ mkdir models && mkdir images wget https://bj.bcebos.com/paddlehub/fastdeploy/resnet50_vd_ptq.tar tar -xvf resnet50_vd_ptq.tar @@ -31,8 +32,9 @@ cp -r ILSVRC2012_val_00000010.jpeg images 4. 编译部署示例,可使入如下命令: ```bash +cd FastDeploy/examples/vision/classification/paddleclas/rv1126/cpp/ mkdir build && cd build -cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-tmivx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-tmivx -DTARGET_ABI=armhf .. +cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-timvx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-timvx -DTARGET_ABI=armhf .. make -j8 make install # 成功编译之后,会生成 install 文件夹,里面有一个运行 demo 和部署所需的库 diff --git a/examples/vision/detection/paddledetection/a311d/cpp/CMakeLists.txt b/examples/vision/detection/paddledetection/a311d/cpp/CMakeLists.txt index 7a145177e..d5627b4e7 100755 --- a/examples/vision/detection/paddledetection/a311d/cpp/CMakeLists.txt +++ b/examples/vision/detection/paddledetection/a311d/cpp/CMakeLists.txt @@ -20,19 +20,11 @@ install(TARGETS infer_demo DESTINATION ./) install(DIRECTORY models DESTINATION ./) install(DIRECTORY images DESTINATION ./) -# install(DIRECTORY run_with_adb.sh DESTINATION ./) -file(GLOB FASTDEPLOY_LIBS ${FASTDEPLOY_INSTALL_DIR}/lib/*) -install(PROGRAMS ${FASTDEPLOY_LIBS} DESTINATION lib) - -file(GLOB OPENCV_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/opencv/lib/lib*) -install(PROGRAMS ${OPENCV_LIBS} DESTINATION lib) - -file(GLOB PADDLELITE_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddlelite/lib/lib*) -install(PROGRAMS ${PADDLELITE_LIBS} DESTINATION lib) - -file(GLOB TIMVX_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddlelite/lib/verisilicon_timvx/*) -install(PROGRAMS ${TIMVX_LIBS} DESTINATION lib) +file(GLOB_RECURSE FASTDEPLOY_LIBS ${FASTDEPLOY_INSTALL_DIR}/lib/lib*.so*) +file(GLOB_RECURSE ALL_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/lib*.so*) +list(APPEND ALL_LIBS ${FASTDEPLOY_LIBS}) +install(PROGRAMS ${ALL_LIBS} DESTINATION lib) file(GLOB ADB_TOOLS run_with_adb.sh) install(PROGRAMS ${ADB_TOOLS} DESTINATION ./) diff --git a/examples/vision/detection/paddledetection/a311d/cpp/README.md b/examples/vision/detection/paddledetection/a311d/cpp/README.md index d0f4ff63a..41e4ab3d2 100755 --- a/examples/vision/detection/paddledetection/a311d/cpp/README.md +++ b/examples/vision/detection/paddledetection/a311d/cpp/README.md @@ -18,11 +18,12 @@ 2. 将编译后的库拷贝到当前目录,可使用如下命令: ```bash -cp -r FastDeploy/build/fastdeploy-tmivx/ FastDeploy/examples/vision/detection/yolov5/a311d/cpp +cp -r FastDeploy/build/fastdeploy-timvx/ FastDeploy/examples/vision/detection/paddledetection/a311d/cpp ``` 3. 在当前路径下载部署所需的模型和示例图片: ```bash +cd FastDeploy/examples/vision/detection/paddledetection/a311d/cpp mkdir models && mkdir images wget https://bj.bcebos.com/fastdeploy/models/ppyoloe_noshare_qat.tar.gz tar -xvf ppyoloe_noshare_qat.tar.gz @@ -33,8 +34,9 @@ cp -r 000000014439.jpg images 4. 编译部署示例,可使入如下命令: ```bash +cd FastDeploy/examples/vision/detection/paddledetection/a311d/cpp mkdir build && cd build -cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-tmivx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-tmivx -DTARGET_ABI=arm64 .. +cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-timvx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-timvx -DTARGET_ABI=arm64 .. make -j8 make install # 成功编译之后,会生成 install 文件夹,里面有一个运行 demo 和部署所需的库 diff --git a/examples/vision/detection/paddledetection/a311d/cpp/infer_ppyoloe.cc b/examples/vision/detection/paddledetection/a311d/cpp/infer_ppyoloe.cc index 609a41d4b..c7b81f9f9 100755 --- a/examples/vision/detection/paddledetection/a311d/cpp/infer_ppyoloe.cc +++ b/examples/vision/detection/paddledetection/a311d/cpp/infer_ppyoloe.cc @@ -24,7 +24,7 @@ void InitAndInfer(const std::string& model_dir, const std::string& image_file) { auto params_file = model_dir + sep + "model.pdiparams"; auto config_file = model_dir + sep + "infer_cfg.yml"; auto subgraph_file = model_dir + sep + "subgraph.txt"; - + fastdeploy::vision::EnableFlyCV(); fastdeploy::RuntimeOption option; option.UseTimVX(); option.SetLiteSubgraphPartitionPath(subgraph_file); diff --git a/examples/vision/detection/paddledetection/rv1126/cpp/README.md b/examples/vision/detection/paddledetection/rv1126/cpp/README.md index 193a269fd..de47ec8bf 100755 --- a/examples/vision/detection/paddledetection/rv1126/cpp/README.md +++ b/examples/vision/detection/paddledetection/rv1126/cpp/README.md @@ -18,11 +18,12 @@ 2. 将编译后的库拷贝到当前目录,可使用如下命令: ```bash -cp -r FastDeploy/build/fastdeploy-tmivx/ FastDeploy/examples/vision/detection/yolov5/rv1126/cpp +cp -r FastDeploy/build/fastdeploy-timvx/ FastDeploy/examples/vision/detection/paddledetection/rv1126/cpp ``` 3. 在当前路径下载部署所需的模型和示例图片: ```bash +cd FastDeploy/examples/vision/detection/paddledetection/rv1126/cpp mkdir models && mkdir images wget https://bj.bcebos.com/fastdeploy/models/ppyoloe_noshare_qat.tar.gz tar -xvf ppyoloe_noshare_qat.tar.gz @@ -33,8 +34,9 @@ cp -r 000000014439.jpg images 4. 编译部署示例,可使入如下命令: ```bash +cd FastDeploy/examples/vision/detection/paddledetection/rv1126/cpp mkdir build && cd build -cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-tmivx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-tmivx -DTARGET_ABI=armhf .. +cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-timvx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-timvx -DTARGET_ABI=armhf .. make -j8 make install # 成功编译之后,会生成 install 文件夹,里面有一个运行 demo 和部署所需的库 diff --git a/examples/vision/detection/yolov5/a311d/cpp/CMakeLists.txt b/examples/vision/detection/yolov5/a311d/cpp/CMakeLists.txt index 3c9eee38a..64b7a6466 100755 --- a/examples/vision/detection/yolov5/a311d/cpp/CMakeLists.txt +++ b/examples/vision/detection/yolov5/a311d/cpp/CMakeLists.txt @@ -21,17 +21,10 @@ install(TARGETS infer_demo DESTINATION ./) install(DIRECTORY models DESTINATION ./) install(DIRECTORY images DESTINATION ./) -file(GLOB FASTDEPLOY_LIBS ${FASTDEPLOY_INSTALL_DIR}/lib/*) -install(PROGRAMS ${FASTDEPLOY_LIBS} DESTINATION lib) - -file(GLOB OPENCV_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/opencv/lib/lib*) -install(PROGRAMS ${OPENCV_LIBS} DESTINATION lib) - -file(GLOB PADDLELITE_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddlelite/lib/lib*) -install(PROGRAMS ${PADDLELITE_LIBS} DESTINATION lib) - -file(GLOB TIMVX_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddlelite/lib/verisilicon_timvx/*) -install(PROGRAMS ${TIMVX_LIBS} DESTINATION lib) +file(GLOB_RECURSE FASTDEPLOY_LIBS ${FASTDEPLOY_INSTALL_DIR}/lib/lib*.so*) +file(GLOB_RECURSE ALL_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/lib*.so*) +list(APPEND ALL_LIBS ${FASTDEPLOY_LIBS}) +install(PROGRAMS ${ALL_LIBS} DESTINATION lib) file(GLOB ADB_TOOLS run_with_adb.sh) install(PROGRAMS ${ADB_TOOLS} DESTINATION ./) diff --git a/examples/vision/detection/yolov5/a311d/cpp/README.md b/examples/vision/detection/yolov5/a311d/cpp/README.md index d47027bb0..0fad86f48 100755 --- a/examples/vision/detection/yolov5/a311d/cpp/README.md +++ b/examples/vision/detection/yolov5/a311d/cpp/README.md @@ -17,11 +17,12 @@ 2. 将编译后的库拷贝到当前目录,可使用如下命令: ```bash -cp -r FastDeploy/build/fastdeploy-tmivx/ FastDeploy/examples/vision/detection/yolov5/a311d/cpp +cp -r FastDeploy/build/fastdeploy-timvx/ FastDeploy/examples/vision/detection/yolov5/a311d/cpp ``` 3. 在当前路径下载部署所需的模型和示例图片: ```bash +cd FastDeploy/examples/vision/detection/yolov5/a311d/cpp mkdir models && mkdir images wget https://bj.bcebos.com/fastdeploy/models/yolov5s_ptq_model.tar.gz tar -xvf yolov5s_ptq_model.tar.gz @@ -32,8 +33,9 @@ cp -r 000000014439.jpg images 4. 编译部署示例,可使入如下命令: ```bash +cd FastDeploy/examples/vision/detection/yolov5/a311d/cpp mkdir build && cd build -cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-tmivx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-tmivx -DTARGET_ABI=arm64 .. +cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-timvx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-timvx -DTARGET_ABI=arm64 .. make -j8 make install # 成功编译之后,会生成 install 文件夹,里面有一个运行 demo 和部署所需的库 diff --git a/examples/vision/detection/yolov5/a311d/cpp/infer.cc b/examples/vision/detection/yolov5/a311d/cpp/infer.cc index f1cf9e8dc..3e57ee4d8 100755 --- a/examples/vision/detection/yolov5/a311d/cpp/infer.cc +++ b/examples/vision/detection/yolov5/a311d/cpp/infer.cc @@ -23,7 +23,7 @@ void InitAndInfer(const std::string& model_dir, const std::string& image_file) { auto model_file = model_dir + sep + "model.pdmodel"; auto params_file = model_dir + sep + "model.pdiparams"; auto subgraph_file = model_dir + sep + "subgraph.txt"; - + fastdeploy::vision::EnableFlyCV(); fastdeploy::RuntimeOption option; option.UseTimVX(); option.SetLiteSubgraphPartitionPath(subgraph_file); diff --git a/examples/vision/detection/yolov5/rv1126/cpp/README.md b/examples/vision/detection/yolov5/rv1126/cpp/README.md index b974a8ebe..437c4c0b9 100755 --- a/examples/vision/detection/yolov5/rv1126/cpp/README.md +++ b/examples/vision/detection/yolov5/rv1126/cpp/README.md @@ -17,11 +17,12 @@ 2. 将编译后的库拷贝到当前目录,可使用如下命令: ```bash -cp -r FastDeploy/build/fastdeploy-tmivx/ FastDeploy/examples/vision/detection/yolov5/rv1126/cpp +cp -r FastDeploy/build/fastdeploy-timvx/ FastDeploy/examples/vision/detection/yolov5/rv1126/cpp ``` 3. 在当前路径下载部署所需的模型和示例图片: ```bash +cd FastDeploy/examples/vision/detection/yolov5/rv1126/cpp mkdir models && mkdir images wget https://bj.bcebos.com/fastdeploy/models/yolov5s_ptq_model.tar.gz tar -xvf yolov5s_ptq_model.tar.gz @@ -32,8 +33,9 @@ cp -r 000000014439.jpg images 4. 编译部署示例,可使入如下命令: ```bash +cd FastDeploy/examples/vision/detection/yolov5/rv1126/cpp mkdir build && cd build -cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-tmivx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-tmivx -DTARGET_ABI=armhf .. +cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-timvx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-timvx -DTARGET_ABI=armhf .. make -j8 make install # 成功编译之后,会生成 install 文件夹,里面有一个运行 demo 和部署所需的库 diff --git a/examples/vision/segmentation/paddleseg/a311d/cpp/CMakeLists.txt b/examples/vision/segmentation/paddleseg/a311d/cpp/CMakeLists.txt index baaf8331f..64b7a6466 100755 --- a/examples/vision/segmentation/paddleseg/a311d/cpp/CMakeLists.txt +++ b/examples/vision/segmentation/paddleseg/a311d/cpp/CMakeLists.txt @@ -20,19 +20,11 @@ install(TARGETS infer_demo DESTINATION ./) install(DIRECTORY models DESTINATION ./) install(DIRECTORY images DESTINATION ./) -# install(DIRECTORY run_with_adb.sh DESTINATION ./) -file(GLOB FASTDEPLOY_LIBS ${FASTDEPLOY_INSTALL_DIR}/lib/*) -install(PROGRAMS ${FASTDEPLOY_LIBS} DESTINATION lib) - -file(GLOB OPENCV_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/opencv/lib/lib*) -install(PROGRAMS ${OPENCV_LIBS} DESTINATION lib) - -file(GLOB PADDLELITE_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddlelite/lib/lib*) -install(PROGRAMS ${PADDLELITE_LIBS} DESTINATION lib) - -file(GLOB TIMVX_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddlelite/lib/verisilicon_timvx/*) -install(PROGRAMS ${TIMVX_LIBS} DESTINATION lib) +file(GLOB_RECURSE FASTDEPLOY_LIBS ${FASTDEPLOY_INSTALL_DIR}/lib/lib*.so*) +file(GLOB_RECURSE ALL_LIBS ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/lib*.so*) +list(APPEND ALL_LIBS ${FASTDEPLOY_LIBS}) +install(PROGRAMS ${ALL_LIBS} DESTINATION lib) file(GLOB ADB_TOOLS run_with_adb.sh) install(PROGRAMS ${ADB_TOOLS} DESTINATION ./) diff --git a/examples/vision/segmentation/paddleseg/a311d/cpp/README.md b/examples/vision/segmentation/paddleseg/a311d/cpp/README.md index 872784188..c4eabf471 100755 --- a/examples/vision/segmentation/paddleseg/a311d/cpp/README.md +++ b/examples/vision/segmentation/paddleseg/a311d/cpp/README.md @@ -17,11 +17,12 @@ 2. 将编译后的库拷贝到当前目录,可使用如下命令: ```bash -cp -r FastDeploy/build/fastdeploy-tmivx/ FastDeploy/examples/vision/segmentation/paddleseg/a311d/cpp +cp -r FastDeploy/build/fastdeploy-timvx/ FastDeploy/examples/vision/segmentation/paddleseg/a311d/cpp ``` 3. 在当前路径下载部署所需的模型和示例图片: ```bash +cd FastDeploy/examples/vision/segmentation/paddleseg/a311d/cpp mkdir models && mkdir images wget https://bj.bcebos.com/fastdeploy/models/rk1/ppliteseg.tar.gz tar -xvf ppliteseg.tar.gz @@ -32,8 +33,9 @@ cp -r cityscapes_demo.png images 4. 编译部署示例,可使入如下命令: ```bash +cd FastDeploy/examples/vision/segmentation/paddleseg/a311d/cpp mkdir build && cd build -cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-tmivx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-tmivx -DTARGET_ABI=arm64 .. +cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-timvx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-timvx -DTARGET_ABI=arm64 .. make -j8 make install # 成功编译之后,会生成 install 文件夹,里面有一个运行 demo 和部署所需的库 diff --git a/examples/vision/segmentation/paddleseg/a311d/cpp/infer.cc b/examples/vision/segmentation/paddleseg/a311d/cpp/infer.cc index b6138e8fb..38f5f7168 100755 --- a/examples/vision/segmentation/paddleseg/a311d/cpp/infer.cc +++ b/examples/vision/segmentation/paddleseg/a311d/cpp/infer.cc @@ -24,7 +24,7 @@ void InitAndInfer(const std::string& model_dir, const std::string& image_file) { auto params_file = model_dir + sep + "model.pdiparams"; auto config_file = model_dir + sep + "deploy.yaml"; auto subgraph_file = model_dir + sep + "subgraph.txt"; - + fastdeploy::vision::EnableFlyCV(); fastdeploy::RuntimeOption option; option.UseTimVX(); option.SetLiteSubgraphPartitionPath(subgraph_file); diff --git a/examples/vision/segmentation/paddleseg/rv1126/cpp/README.md b/examples/vision/segmentation/paddleseg/rv1126/cpp/README.md index bf7cafc3b..5975ac3f6 100755 --- a/examples/vision/segmentation/paddleseg/rv1126/cpp/README.md +++ b/examples/vision/segmentation/paddleseg/rv1126/cpp/README.md @@ -17,7 +17,7 @@ 2. 将编译后的库拷贝到当前目录,可使用如下命令: ```bash -cp -r FastDeploy/build/fastdeploy-tmivx/ FastDeploy/examples/vision/segmentation/paddleseg/rv1126/cpp +cp -r FastDeploy/build/fastdeploy-timvx/ FastDeploy/examples/vision/segmentation/paddleseg/rv1126/cpp ``` 3. 在当前路径下载部署所需的模型和示例图片: @@ -33,7 +33,7 @@ cp -r cityscapes_demo.png images 4. 编译部署示例,可使入如下命令: ```bash mkdir build && cd build -cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-tmivx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-tmivx -DTARGET_ABI=armhf .. +cmake -DCMAKE_TOOLCHAIN_FILE=${PWD}/../fastdeploy-timvx/toolchain.cmake -DFASTDEPLOY_INSTALL_DIR=${PWD}/../fastdeploy-timvx -DTARGET_ABI=armhf .. make -j8 make install # 成功编译之后,会生成 install 文件夹,里面有一个运行 demo 和部署所需的库