你需要准备
我使用的是官方的烧录工具Raspberry Pi Imager,选用的系统是Raspberry Pi OS(Legacy)
一个基于 Debian Buster 的 Raspberry Pi OS 的遗留版本(Legacy)
账号 pi
密码 raspberry
遇到什么都确认就好,要保证网络畅通
sudo apt-get update
sudo apt-get upgrade
pi os安装好默认带有两个python版本,默认的是python2.7。为防止因版本过低而造成的报错,我这里直接卸载python2.7。
卸载python2.7
sudo apt-get autoremove python2.7
新建链接将默认python改为python3
sudo ln -s /usr/bin/python3.5 /usr/bin/python
依次运行下列指令
which pip
pip
type pip
hash -r
sudo apt-get install libopenblas-dev libblas-dev m4 cmake cython python3-dev python3-yaml python3-setuptools python3-wheel python3-pillow python3-numpy
在命令行输入
cd /home/pi
pip3 install torch-1.8.0a0+56b43f4-cp37-cp37m-linux_armv7l.whl
pip3 install torchvision-0.9.0a0+8fb5838-cp37-cp37m-linux_armv7l.whl
sudo apt-get install python3-opencv
python
import cv2
下载Yolov5
git clone https://github.com/ultralytics/yolov5
因为requirements.txt里面的opencv-python,torch,torchvision安装的时候会出现问题,所以先把依赖文件里面的opencv-python,torch,torchvision注释掉(torch和torchvision前面是装过的所以没关系)
cd /home/pi/yolov5
sudo nano requirements.txt
在前面加“# ”
写入
Ctrl + O
Enter
退出
Ctrl + X
Enter
再安装依赖,加上–default-timeout=1000参数防止超时
cd /home/pi/yolov5
pip3 install --default-timeout=1000 -r requirements.txt
cd /home/pi/yolov5
python3 detect.py
知乎链接
sudo raspi-config
使用VNC viewer连接树莓派(需自行安装VNC viewer)
页面全部关掉就好
cd /home/pi/yolov5
python3 detect.py --source 0
https://baijiahao.baidu.com/s?id=1718556879296833057
https://blog.csdn.net/m0_46410698/article/details/120390460
https://blog.csdn.net/weixin_39965127/article/details/102686314
https://www.jianshu.com/p/7a954aa5b5c2
https://github.com/nmilosev/pytorch-arm-builds
https://blog.csdn.net/Eric_Fisher/article/details/108861727
https://blog.csdn.net/Crazysai2012/article/details/108872532
https://blog.csdn.net/weixin_43878078/article/details/103893426
https://blog.csdn.net/qq_39712148/article/details/107148832
https://blog.csdn.net/m0_46410698/article/details/120390460
https://blog.csdn.net/weixin_39965127/article/details/102686314
https://stackoverflow.com/questions/43298872/how-to-solve-readtimeouterror-httpsconnectionpoolhost-pypi-python-org-port
https://developer.aliyun.com/article/619208
https://blog.csdn.net/qq_15192373/article/details/104597622
https://newbedev.com/from-cv2-import-importerror-libcblas-so-3-cannot-open-shared-object-file-no-such-file-or-directory-code-example
https://blog.csdn.net/CAU_Ayao/article/details/83990246
https://stackoverflow.com/questions/53347759/importerror-libcblas-so-3-cannot-open-shared-object-file-no-such-file-or-dire
https://blog.csdn.net/shenqiongniujiahui/article/details/50494172
https://blog.csdn.net/armkits/article/details/103200433
https://blog.csdn.net/huayucong/article/details/51706252
https://blog.csdn.net/dwj1979/article/details/105622390/
https://www.cxyzjd.com/article/qq_22945165/113541514
https://blog.csdn.net/weixin_51110161/article/details/114681830