Cmake安装
apt install build-essential zlib1g-dev libssl-dev
wget https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2.tar.gz
tar -zxvf cmake-3.23.2.tar.gz
cd cmake-3.23.2
./bootstrap
make
make install
cmake --version
在Github或者gitee 查阅PaddlePaddle/FastDeploy 的相关文档
两种方式安装fastdeploy
使用预编译
参考:
复制地址执行(gitee有跳转,):
wegt https://bj.bcebos.com/fastdeploy/release/cpp/fastdeploy-linux-x64-
测试
tar -xvf fastdeploy-linux-x64-1.0.2.tgz
编译paddledetection的c++
cd fastdeploy-linux-x64-1.0.2/examples/vision/detection/paddledetection/cpp
vim CMakeList.txt
set(FASTDEPLOY_INSTALL_DIR /usr/local/fastdeploy-linux-x64-1.0.2)
mkdir build && cd build
cmake ..
make -j2
下载模型和图
wget https://bj.bcebos.com/paddlehub/fastdeploy/ppyoloe_crn_l_300e_coco.tgz
wget https://bj.bcebos.com/fastdeploy/tests/test_det.jpg
tar xvf ppyoloe_crn_l_300e_coco.tgz
测试
./infer_ppyoloe_demo ppyoloe_crn_l_300e_coco test_det.jpg 0
结果
自行编译
参考:
安装opencv
apt install -y wget unzip
apt-get install build-essential libgtk2.0-dev libgtk-3-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev
下载opencv
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.5.0.zip
unzip opencv.zip
mv opencv-4.5.0 opencv
cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D OPENCV_GENERATE_PKGCONFIG=YES ..
make -j4
make install
apt install git
git --version
git clone https://github.com/PaddlePaddle/FastDeploy.git
cd FastDeploy
mkdir build && cd build
注意DOPENCV_DIRECTORY
cmake .. -DENABLE_ORT_BACKEND=ON \
-DENABLE_PADDLE_BACKEND=ON \
-DENABLE_OPENVINO_BACKEND=ON \
-DCMAKE_INSTALL_PREFIX=${PWD}/compiled_fastdeploy_sdk \
-DENABLE_VISION=ON \
-DOPENCV_DIRECTORY=/usr/local/lib/cmake/opencv4 \
make -j2
make install
测试
cd compiled_fastdeploy_sdk/examples/vision/detection/paddledetection/cpp
vim CMakeLists.txt
在CMakeLists.txt中添加
set(FASTDEPLOY_INSTALL_DIR /usr/local/FastDeploy/build/compiled_fastdeploy_sdk)
mkdir build && cd build
cmake ..
make -j2
wget https://bj.bcebos.com/paddlehub/fastdeploy/ppyoloe_crn_l_300e_coco.tgz
wget https://bj.bcebos.com/fastdeploy/tests/test_det.jpg
tar xvf ppyoloe_crn_l_300e_coco.tgz
./infer_ppyoloe_demo ppyoloe_crn_l_300e_coco test_det.jpg 0