申威芯片UOS中opencv DNN部署推理

Cmake,opencv,opencv-contribute安装

#apt可能需要更新apt update
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

#安装cmake
apt install cmake
查看cmake
cmake -version
#下载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

#下载opencv_contrib
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.5.0.zip
unzip opencv_contrib.zip
mv opencv_contrib-4.5.0  opencv_contrib

mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -DINSTALL_PYTHON_EXAMPLES=ON \
    -DINSTALL_C_EXAMPLES=ON \
    -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules \
    -DBUILD_EXAMPLES=ON ..

make -j4
make install

编译opencv dnn yolov5

#配置CMakeLists.txt,放入工程

cmake_minimum_required(VERSION 2.8)
project( yolo )
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable( yolo main.cpp yolo.cpp )
target_link_libraries( yolo ${OpenCV_LIBS} )

在opencvdnn工程中:

mkdir build && build
cmake ..
make -j4
./yolo

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值