当前位置:网站首页>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-112: path sum
- ECMAScript -- "ES6 syntax specification # Day1
- Opencv gray histogram, histogram specification
- CV learning notes ransca & image similarity comparison hash
- 4.1 Temporal Differential of one step
- 20220603 Mathematics: pow (x, n)
- Deep Reinforcement learning with PyTorch
- Leetcode - 706 design hash mapping (Design)*
- Qcombox style settings
- LeetCode - 508. Sum of subtree elements with the most occurrences (traversal of binary tree)
猜你喜欢
Label Semantic Aware Pre-training for Few-shot Text Classification
LeetCode - 5 最长回文子串
2.2 DP: Value Iteration & Gambler‘s Problem
Implementation of "quick start electronic" window dragging
LeetCode - 1670 设计前中后队列(设计 - 两个双端队列)
LeetCode - 900. RLE 迭代器
Basic use and actual combat sharing of crash tool
Leetcode - 705 design hash set (Design)
Deep Reinforcement learning with PyTorch
Leetcode 300 longest ascending subsequence
随机推荐
Leetcode - 460 LFU cache (Design - hash table + bidirectional linked hash table + balanced binary tree (TreeSet))*
Step 1: teach you to trace the IP address of [phishing email]
ECMAScript -- "ES6 syntax specification # Day1
CV learning notes - clustering
20220602 Mathematics: Excel table column serial number
CV learning notes convolutional neural network
3.2 Off-Policy Monte Carlo Methods & case study: Blackjack of off-Policy Evaluation
Opencv gray histogram, histogram specification
Codeup: word replacement
What can I do to exit the current operation and confirm it twice?
[LZY learning notes dive into deep learning] 3.4 3.6 3.7 softmax principle and Implementation
Opencv Harris corner detection
Leetcode bit operation
Connect Alibaba cloud servers in the form of key pairs
20220603数学:Pow(x,n)
CV learning notes - BP neural network training example (including detailed calculation process and formula derivation)
Hands on deep learning pytorch version exercise solution - 2.4 calculus
LeetCode - 715. Range module (TreeSet)*****
Leetcode - 5 longest palindrome substring
Model evaluation and selection