mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-16 05:30:58 +08:00
[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
This commit is contained in:
10
cmake/flycv.cmake
Normal file → Executable file
10
cmake/flycv.cmake
Normal file → Executable file
@@ -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}")
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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 ./)
|
||||
|
@@ -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 和部署所需的库
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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 和部署所需的库
|
||||
|
@@ -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 ./)
|
||||
|
@@ -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 和部署所需的库
|
||||
|
@@ -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);
|
||||
|
@@ -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 和部署所需的库
|
||||
|
@@ -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 ./)
|
||||
|
@@ -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 和部署所需的库
|
||||
|
@@ -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);
|
||||
|
@@ -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 和部署所需的库
|
||||
|
@@ -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 ./)
|
||||
|
@@ -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 和部署所需的库
|
||||
|
@@ -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);
|
||||
|
@@ -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 和部署所需的库
|
||||
|
Reference in New Issue
Block a user