YOLOv8 model training (simple to use and easy to learn)

YOLOv8 

 YOLOv8 is the next major update version of YOLOv5 ,     which was open sourced by ultralytics on January 10, 2023. It  currently supports image classification, object detection and instance segmentation tasks.


Specific to the YOLOv8 algorithm, its core features and changes can be summarized as follows:

1. Provides a new SOTA model, including P5 640 and P6 1280 resolution target detection networks and YOLACT-based instance segmentation models. Like YOLOv5, models of different sizes in N/S/M/L/X scales are also provided based on scaling factors to meet the needs of different scenarios. 2. The backbone
network and Neck part may refer to the YOLOv7 ELAN design idea, and the C3 of YOLOv5 The structure was replaced by a C2f structure with richer gradient flow, and different channel numbers were adjusted for models of different scales. This is a careful fine-tuning of the model structure. It is no longer a brainless set of parameters to apply to all models, which greatly improves model performance. However, the Split and other operations in this C2f module are not as friendly to specific hardware deployment as before.
3. The Head part has been greatly changed compared to YOLOv5. It has been replaced by the current mainstream decoupling head structure, which separates the classification and detection heads. Anchor-Based was replaced by Anchor-Free
4. Loss calculation adopted the TaskAlignedAssigner positive sample distribution strategy, and introduced the Distribution Focal Loss
training data enhancement part. The last 10 epochs in YOLOX were introduced to turn off the Mosiac enhanced operation, which can effectively Improve accuracy.

 The figure below shows the performance comparison.

Project starts

The task that can be used in this project is to identify the content of the table

First go to the GitHub website to download the source code

Download and decompress the installation package through download zip, and then enter the directory to install the environment.

You can use the command to install and then perform environmental testing.

pip install -r requirements.txt
pip install ultralytics
yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'

 Next is training. Here is the data set path we prepared, and we need to write it into a yaml file.

Finally, just use the command to train

yolo train data=coco128.yaml model=yolov8n.pt epochs=10 lr0=0.01

Next, I will show you the results of my training.

 

 

Guess you like

Origin blog.csdn.net/qq_54575112/article/details/132296178