当前位置:网站首页>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
边栏推荐
- Judging the connectivity of undirected graphs by the method of similar Union and set search
- 20220610 other: Task Scheduler
- CV learning notes - Stereo Vision (point cloud model, spin image, 3D reconstruction)
- Opencv histogram equalization
- Tensorflow2.0 save model
- Notes - regular expressions
- Qcombox style settings
- Model evaluation and selection
- CV learning notes - image filter
- 20220602 Mathematics: Excel table column serial number
猜你喜欢

Neural Network Fundamentals (1)

What can I do to exit the current operation and confirm it twice?

CV learning notes - BP neural network training example (including detailed calculation process and formula derivation)

Hands on deep learning pytorch version exercise solution -- implementation of 3-2 linear regression from scratch

Implementation of "quick start electronic" window dragging

【C 题集】of Ⅵ

LeetCode - 1670 设计前中后队列(设计 - 两个双端队列)

Hands on deep learning pytorch version exercise solution - 2.4 calculus

2.1 Dynamic programming and case study: Jack‘s car rental

Opencv notes 17 template matching
随机推荐
Deep learning by Pytorch
Pycharm cannot import custom package
Leetcode interview question 17.20 Continuous median (large top pile + small top pile)
Leetcode - 706 design hash mapping (Design)*
Leetcode-106:根据中后序遍历序列构造二叉树
Leetcode-112: path sum
20220531 Mathematics: Happy numbers
『快速入门electron』之实现窗口拖拽
About windows and layout
2018 Lenovo y7000 black apple external display scheme
CV learning notes - reasoning and training
Opencv notes 20 PCA
Hands on deep learning pytorch version exercise solution - 2.6 probability
Label Semantic Aware Pre-training for Few-shot Text Classification
[C question set] of Ⅵ
Hands on deep learning pytorch version exercise answer - 2.2 preliminary knowledge / data preprocessing
Hands on deep learning pytorch version exercise solution - 2.5 automatic differentiation
Cases of OpenCV image enhancement
Leetcode - 1670 conception de la file d'attente avant, moyenne et arrière (conception - deux files d'attente à double extrémité)
Step 1: teach you to trace the IP address of [phishing email]