pyton\yolov8 installation and basic use, training and prediction

    First go to the official website to download yolov8, the official address , after downloading the compressed package, unzip it to pycharm and open it. I personally use pycharm, and the next step is to operate in pycharm. (Professional version of pycharm)

 

 The official documentation of yolov8 states that the necessary environment python-3.7.0 pyTorch>=1.7, these two environments are well configured,

Python is now basically greater than version 3.7, and pyTorch can be downloaded using pip on the terminal. Command: pip install torch>=1.7 If the download is too slow, you can add Tsinghua Park by yourself.

 After the environment is set up, you can download and install yolov8. The official document also explains it. Enter in the terminal: 

pip install -r .\requirements.txt   

The above is to install an overall package

pip install ultralytics This is also required (if not installed, you cannot use the yolo command in the terminal)

After the above steps are completed, the next step is to verify whether yolov8 is installed, and run such a command in the terminal:

yolo predict model=yolov8n.pt source='ultralytics/assets/bus.jpg' show=True save=True

(This command is not the same as the official document. The official document is to obtain its pictures on the Internet through the link. I use it directly. Only the ones downloaded from the official website are available. show=True is to display pictures. save =True is to save the picture)

 Here yolov8 is installed. This is the cpu version. I am also exploring the GPU, so I won’t make a fool of myself. If you don’t want to verify at the terminal, you can also go to ultralytics-main\ultralytics\yolo\v8\detect\predict.py In this python file, modify the path of the picture and then run it. The path of the picture is the same as above.

Guess you like

Origin blog.csdn.net/weixin_65996583/article/details/129841252