当前位置:网站首页>Raspberry pie 4B installs yolov5 to achieve real-time target detection
Raspberry pie 4B installs yolov5 to achieve real-time target detection
2022-07-03 10:24:00 【Shenzhen University of technology affiliated middle school open】
Raspberry pie 4b install yolov5 Achieve real-time target detection
Preparation before start
You need to prepare
- A camera
Here is the official raspberry pie camera v2 - Be able to access the Internet scientifically
System
I use the official burning tool Raspberry Pi Imager, The selected system is Raspberry Pi OS(Legacy)
One is based on Debian Buster Of Raspberry Pi OS Legacy version of (Legacy)

adopt PuTTY Tool connected to raspberry pie



Log in with the default password for raspberry pie
account number pi
password raspberry


preparation
Update raspberry pie
Just confirm everything you encounter , To ensure smooth network
sudo apt-get update
sudo apt-get upgrade

take python Set to default python3
pi os After installation, there are two by default python edition , The default is python2.7. To prevent errors caused by too low version , I will uninstall directly here python2.7.
uninstall python2.7
sudo apt-get autoremove python2.7
New links will default python Change it to python3
sudo ln -s /usr/bin/python3.5 /usr/bin/python

Resolve delete python2 after pip Problems that cannot be used
Run the following commands in sequence
which pip
pip
type pip
hash -r
install Pytorch
Installation dependency
sudo apt-get install libopenblas-dev libblas-dev m4 cmake cython python3-dev python3-yaml python3-setuptools python3-wheel python3-pillow python3-numpy

Use WinSCP Copy the installation package to raspberry pie
Download... From here Installation package download link 



install torch and torchvision
Enter at the command line
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
This is the screen of inputting instructions after installation 
install Opencv
sudo apt-get install python3-opencv
This is the screen of inputting instructions after installation 
Check Opencv Can it be used normally
python
import cv2

install Yolov5
download Yolov5
git clone https://github.com/ultralytics/yolov5
because requirements.txt Inside opencv-python,torch,torchvision There will be problems during installation , So let's put the... In the dependent file first opencv-python,torch,torchvision Comment out (torch and torchvision The front is installed, so it doesn't matter )
cd /home/pi/yolov5
sudo nano requirements.txt
Add... To the front “# ”
write in
Ctrl + O
Enter
sign out
Ctrl + X
Enter
Re install dependency , add –default-timeout=1000 Parameters prevent timeout
cd /home/pi/yolov5
pip3 install --default-timeout=1000 -r requirements.txt
Don't worry about him if you report a mistake 
A test run
cd /home/pi/yolov5
python3 detect.py
Picture of successful operation 
install Camera v2
stay yolov5 Use the camera to detect the target
open VNC Function connection raspberry pie
sudo raspi-config
successively Enter determine 



Modify resolution 

Direct change to maximum 

restart 
Use VNC viewer Connect the raspberry pie ( Self installation is required VNC viewer)

Just close all the pages
cd /home/pi/yolov5
python3 detect.py --source 0
Successful detection

Reference material
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
边栏推荐
- Leetcode - 1670 design front, middle and rear queues (Design - two double ended queues)
- openCV+dlib實現給蒙娜麗莎換臉
- Step 1: teach you to trace the IP address of [phishing email]
- Deep Reinforcement learning with PyTorch
- When the reference is assigned to auto
- Label Semantic Aware Pre-training for Few-shot Text Classification
- LeetCode - 919. Full binary tree inserter (array)
- CV learning notes - reasoning and training
- MySQL root user needs sudo login
- Deep learning by Pytorch
猜你喜欢

Leetcode - the k-th element in 703 data flow (design priority queue)

Hands on deep learning pytorch version exercise solution-3.3 simple implementation of linear regression

Flutter 退出当前操作二次确认怎么做才更优雅?

CV learning notes - reasoning and training

ECMAScript -- "ES6 syntax specification # Day1

Boston house price forecast (tensorflow2.9 practice)

Anaconda安装包 报错packagesNotFoundError: The following packages are not available from current channels:

Hands on deep learning pytorch version exercise solution - 2.4 calculus

ECMAScript--》 ES6语法规范 ## Day1
![[C question set] of Ⅵ](/img/49/eb31cd26f7efbc4d57f17dc1321092.jpg)
[C question set] of Ⅵ
随机推荐
Flutter 退出当前操作二次确认怎么做才更优雅?
Dynamic layout management
Tensorflow2.0 save model
Toolbutton property settings
Anaconda installation package reported an error packagesnotfounderror: the following packages are not available from current channels:
Standard library header file
Octave instructions
What did I read in order to understand the to do list
Leetcode-112:路径总和
20220608其他:逆波兰表达式求值
2-program logic
Hands on deep learning pytorch version exercise solution -- implementation of 3-2 linear regression from scratch
[C question set] of Ⅵ
pycharm 无法引入自定义包
Hands on deep learning pytorch version exercise solution - 2.6 probability
Basic use and actual combat sharing of crash tool
LeetCode - 715. Range 模块(TreeSet) *****
ECMAScript -- "ES6 syntax specification # Day1
【毕业季】图匮于丰,防俭于逸;治不忘乱,安不忘危。
One click generate traffic password (exaggerated advertisement title)