Installation of target detection yolov5

learn better from others,

be the better one.

—— "Weika Zhixiang"

09b98526c1c75d6b81390ad6b7546edd.jpeg

The length of this article is 1108 words , and it is expected to read for 4 minutes

foreword

Target detection yolov5 is still used more, this article is a brief introduction to the installation of yolov5.

b8b1bbb68545c4da74ba17efa8365211.png

Installation Environment

System: Windows

Environment: MiniConda

01

Download the source code of yolov5

Source address: https://github.com/ultralytics/yolov5

cb6cb5c39fce3620643c9a33c46a1397.png

ea017e6309899422f379a4e6bed893cd.png

Created a yolov5 folder locally and downloaded it directly.

02

Create and activate a virtual environment

dec124f6ffb0eff6f1639f87bd9b0934.png

Open Anaconda Powershell Prompt (miniconda3)

f0205e15ca751ff7736cec5d313d6993.png

Create a virtual environment, here I have created it before, so only the creation code is listed

conda create -n your_env_name python=x.x -y  
# 我的是
conda create -n yolov5 python=3.9 -y

Activate the current virtual environment

conda activate yolov5

5a47ead31ff8094b7831efd83af401c8.png

As you can see from the above picture, after activation, the front becomes yolov5

03

Install required third-party libraries

First enter the folder where we downloaded yolov5

2cb5b90b98961b549c2e101ffa97971e.png

Then enter at the command line

pip install -r requirement.txt

It can also be the installation of the mirror image below, which will be faster, but my network speed is problematic, I have installed it many times, and finally it is finished

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

04

Download the pretrained model file

Model file address:

https://github.com/ultralytics/yolov5/releases/tag/v7.0

It has been updated to the latest version 7.0, but it still comes back to the problem of network speed. The network in the hotel outside is really not working, and the download is incomplete after a long time. Finally, I found a way and recommended a website:

https://d.serctl.com/

6ce7a072384e3aee9ef8b887e33887d3.png

For files on Github, you can directly enter the link here, and then download it from here.

4e2050ba4ad9af66070f58f5698f8c93.png

Copy the downloaded pre-trained model files to the yolov5 folder. In this way, the installation environment of Yolov5 is completely completed.

Micro card Zhixiang

Test Yolov5

Use VS Code to open the yolov5 folder

1e97dce3032c306cba539e934fb2cc54.png

Find the detect.py file. In the above figure, parse_opt is a default parameter that can be set using command line operations. But I still prefer to run with a compiler.

924fc36f210bbd8337e36a801420a09d.png

c2d2fe709a101460a6989dd5106330b0.png

The detection result of the operation can finally be seen under runs\detect\exp31 is the result of the operation, find the directory

7ceaa011958fd799a2e9c67db3335d25.png

In the picture above, there are only two pictures by default. I copied some of them myself to see the effect.

aae01ddacd8f212a97b0cd327124dbf7.png

c180914c7fefd95ec17cb5a7b29c472c.png

ff62d69cf7bf3945615e66127e217e16.png

9d97286da6e59a6ac6ff7665dccc391d.png

The detection is no problem at all, so the environment of yolov5 is set up.

over

a29d71ab8362aef8ff9a9e1644bc074f.png

e22e3d1e33db8250a1596bb8e5830717.png

Wonderful review of the past

 

277fb6683110f43e27205c4438ce2445.jpeg

Getting Started with pyTorch (6) - Practical Android Minist OpenCV Handwritten Number Recognition (with source code address)

 

 

149f059a46db2a07740900e826a592ae.jpeg

Getting started with pyTorch (5) - training your own data set

 

 

6cd22113b4a0977ab558aa8bb2852ff8.jpeg

Getting started with pyTorch (4) - export the Minist model, C++ OpenCV DNN for recognition

 

Guess you like

Origin blog.csdn.net/Vaccae/article/details/128630924