Yolo-FastestV2配置环境

配置环境

Debian换源

修改配置文件
sudo nano /etc/apt/sources.list

内容修改为

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free
执行更新
sudo apt update && sudo apt upgrade

NCNN

环境配置
sudo apt-get install -y gfortran
sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libprotoc-dev
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install -y libgflags-dev libgoogle-glog-dev liblmdb-dev libatlas-base-dev
获取ncnn
cd ncnn
git clone https://github.com/Tencent/ncnn
修改CMakeList.txt

add_subdirectory(examples)
add_subdirectory(benchmark)

前的注释删除

编译安装ncnn
cd build
mkdir build
cmake ../
make -j4
make install 

Opencv安装

安装python & pip
sudo apt install python3 -y
sudo apt install -y python3-pip
配置pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple 

pip3 install --upgrade pip
安装opencv
pip3 install opencv-python opencv-contrib-python numpy matplotlib opencv-python-headless
pip3 install onnxruntime  onnx-simplifier onnx skl2onnx
验证OpenCV安装
# python3
> import cv2
> cv2.__version__
ncnn环境变量
sudo cp ~/ncnn/build/install/include/ncnn/* /usr/include/
sudo mkdir -p /usr/local/lib/ncnn/
sudo cp ncnn/build/src/libncnn.a /usr/local/lib/ncnn/

/etc/profile写入

export PATH=$PATH:$HOME/bin
C_INCLUDE_PATH=/usr/include/:/usr/include/opencv4:$C_INCLUDE_PATH
export C_INCLUDE_PATH
CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/:/usr/include/opencv4
export CPLUS_INCLUDE_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/include/:/usr/include/opencv4
export LD_LIBRARY_PATH
LIBRARY_PATH=$LIBRARY_PATH:/usr/include/:/usr/include/opencv4
export LIBRARY_PATH

测试ncnn

前提

  • 64位树莓派系统
  • NCNN框架
  • 64位opencv
  • 安装codeblocks sudo apt-get install codeblocks

获取yolofast2-yolo for RPi

wget https://github.com/Qengineering/YoloFastestV2-ncnn-Raspberry-Pi-4/archive/refs/heads/main.zip

or

git clone https://github.com/Qengineering/YoloFastestV2-ncnn-Raspberry-Pi-4

解压,使用codeblocks打开YoloFastestV2.cbp,编译运行

安装yolo fastest

环境配置
sudo apt install git
git clone https://github.com/dog-qiuqiu/Yolo-FastestV2.git
#失败时可以改为git clone git://github.com/dog-qiuqiu/Yolo-FastestV2.git
  • armv7l
pip install torch torchvision torchsummary -f https://torch.maku.ml/whl/stable.html
pip install -r Yolo-FastestV2\requirements.txt
  • others
pip install -r Yolo-FastestV2\requirements.txt
验证安装
cd Yolo-FastestV2
python3 test.py --data data/coco.data --weights modelzoo/coco2017-epoch-0.235624ap-model.pth --img img/000230.jpg
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值