Try running the YOLOv5 project

1. Download the project from GitHub https://github.com/ultralytics/yolov5

Select the v5 version, open it with Pycharm, and select the built Conda—pytorch1 (python=3.8) environment (installed in the previous configuration pytorch)

2. Install the corresponding package (the author provides the requirement.txt file)

①According to the above intelligent prompt that comes with pycharm install

Or ② install with the command line pip install -r requirements.txt

——There are two main types of errors in this step.

Ⅰpip does not provide, use the domestic mirror to download successfully

Ⅱ pycocotools问题,“ERROR: Failed building wheel for pycocotools”

error:Microsoft Visual C+ 14. 0 or greater is required. Cet it with Microsoft C-t Build Tools : https://visualstudio.microsof t.com'visualt

Mainly because the maintainer of pycocotools no longer provides support for the Windows platform, the download of VisualStudio generation tool 2019 was successful. Please note that you do not need to download the VisualStudio profession "VisualStudio 2022"

 After the error is resolved, all packages are installed successfully

2. Run in detect.py

If an error occurs, Baidu will resolve it.

Running success result

 3. Analysis

——The input can be pictures or videos, which are in yolov5-5.0/data/images/; the output results are saved in yolov5-5.0/runs/detect/expx, and the results will be obtained once you run it.

——In the detect.py file, parameters can be modified:

 conf-thres: Confidence, the default of 0.25 means that when the detected things in the picture exceed the 0.25 confidence level, they will be detected.

Guess you like

Origin blog.csdn.net/qq_51141671/article/details/131438079