Yolov5, yolov7, yolov8 train your own data set (you don’t need to configure the environment, you can train your own data set in just 3 steps)

1. Download environment

Baidu cloud network disk link. Extract code: moo3

      1. Copy the link of the network disk into the Baidu cloud network disk, download the content of the network disk, and unzip it to the computer (any disk is fine).

The decompressed file looks like this, this is the environment needed to run yolov5! ! ! ! ! ! ! ! ! ! ! ! ! ! !

     

2. Open the pycharm software or other compilation software to configure the environment! ! (very easy!)

2.1 Click the File button in the upper right corner.

2.2 Click settings.

2.3 Click on the python interpreter in the project

 2.4 Click the Add button

 2.5 Click the three dots next to Existing environment.

 2.6 Select the path as the python.exe path in the Tools folder in the decompressed file in Baidu Cloud.

2.7 Click ok all the way When Python3.7 (gqh) appears in the lower right corner of your pycharm, it means that the environment has been configured. This environment can already run any algorithm of the yolo series, including yolov7 and yolov8. The following is the code setting of YOLOv5.

Second, divide and transform the data set! ! ! ! !

 Partition: The dataset is divided into training set, validation set and test set.

 Conversion: Convert tags in xml format to txt format.

  The data set format required by yolo is in txt format, but most of the data sets on the Internet are in xml format, so we need to convert the data set in xml format to txt format first.

Download this VOCData folder from Baidu Cloud and unzip it into the yolov5 code.

VOCData folder Baidu cloud network disk link. Extract code: moo3

yolov5 official code Baidu cloud network disk link. Extract code: moo3

1. Copy your own xml tags into the Annotations file. Copy your images into the images folder.

2. Clear all the contents under the three folders of dataSet_path, imagesets and labels.

3. Edit the houzhuan.py script, don't run it just edit! ! ! Follow the Chinese prompts inside to set the path in the script! ! ! ! ! ! ! ! ! !

4. Click to run xianfeng.py first, and then click houzhuan.py. At this point, the data set division and conversion are completed.

3. yolov5 code setting

3.1 Create a coco128.yaml file in the data folder 

The path of train and val is set according to your own path, and the value in names is the name of the category you want to detect. The value of nc is the number of categories.

3.2 Click train.py to pull down and set these three parameters like this.

4. It's over! ! ! ! You can click train.py to train your own data set! ! ! !

Guess you like

Origin blog.csdn.net/jsnuchao/article/details/129863691