UOS系统下fastdeploy推理

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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值