Skip to content

Commit

Permalink
[Other] Add FlyCV support for A311D (PaddlePaddle#928)
Browse files Browse the repository at this point in the history
* add FlyCV support

* update doc

* update cmake

* re-ci

* fix bug

* fix cmake

* fix doc

* update doc

* fix doc
  • Loading branch information
yeliang2258 authored Dec 21, 2022
1 parent c8c204f commit 1e9872d
Show file tree
Hide file tree
Showing 21 changed files with 71 additions and 82 deletions.
10 changes: 7 additions & 3 deletions cmake/flycv.cmake
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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}")
Expand Down
7 changes: 4 additions & 3 deletions docs/cn/build_and_install/a311d.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FastDeploy 基于 Paddle Lite 后端支持在晶晨 NPU 上进行部署推理。

## 交叉编译环境搭建

### 宿主机环境需求
### 开发机环境需求
- os:Ubuntu == 16.04
- cmake: version >= 3.10.0

Expand Down Expand Up @@ -59,15 +59,16 @@ 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 ..

# Build FastDeploy A311D C++ SDK
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
Expand Down
6 changes: 3 additions & 3 deletions docs/cn/build_and_install/rv1126.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FastDeploy基于 Paddle Lite 后端支持在瑞芯微(Rockchip)Soc 上进行

## 交叉编译环境搭建

### 宿主机环境需求
### 开发机环境需求
- os:Ubuntu == 16.04
- cmake: version >= 3.10.0

Expand Down Expand Up @@ -59,15 +59,15 @@ 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 ..

# Build FastDeploy RV1126 C++ SDK
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
Expand Down
7 changes: 4 additions & 3 deletions docs/en/build_and_install/a311d.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/en/build_and_install/rv1126.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 4 additions & 12 deletions examples/vision/classification/paddleclas/a311d/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./)
6 changes: 4 additions & 2 deletions examples/vision/classification/paddleclas/a311d/cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 和部署所需的库
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 和部署所需的库
Expand Down
16 changes: 4 additions & 12 deletions examples/vision/detection/paddledetection/a311d/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./)
6 changes: 4 additions & 2 deletions examples/vision/detection/paddledetection/a311d/cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 和部署所需的库
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 和部署所需的库
Expand Down
15 changes: 4 additions & 11 deletions examples/vision/detection/yolov5/a311d/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./)
6 changes: 4 additions & 2 deletions examples/vision/detection/yolov5/a311d/cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 和部署所需的库
Expand Down
2 changes: 1 addition & 1 deletion examples/vision/detection/yolov5/a311d/cpp/infer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions examples/vision/detection/yolov5/rv1126/cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 和部署所需的库
Expand Down
16 changes: 4 additions & 12 deletions examples/vision/segmentation/paddleseg/a311d/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./)
Loading

0 comments on commit 1e9872d

Please sign in to comment.