Yolov5_6.2 training model method and data preparation

Methods and data preparation for training models____
========================

======================================================================

TrainFile
===========================Data set
home/user/datasTrainALL/
1 First go to the corresponding path:
PS C:\Users\VRC \Desktop> 
2 Execute
scp -r ./Mydatas [email protected]:/home/user/datasTrainALL/Mynewdatas_2304 in the path of the folder to be copied
. Explanation: ./Mydatas is the name of the file to be copied   
            [email protected]: /home/user/datasTrainALL/Mynewdatas_2304 The server path to copy to

Notes and steps:
1 All json files in the output need to be copied to the path where all json is stored.
2 During training, copy all the images that need to be trained to the home/user/TrainFile/datasTrain/images/train path.
3 cp /home /user/datasTrainALL/LQ_OrdinaryRoad02_6137_3.16GB/* /home/user/TrainFile/datasTrain/images/train/
4 View the number of files in the current folder: ls -l | grep "^-" | wc -l
5 Enter training python environment: source activate yolov5t 
    to see what the current conda environment is? conda env list
6 Execute the function split_train_val_test() in json2txt.py to divide train and val
7 Execute the function json2txt() in json2txt.py to generate txt files corresponding to the images in train and
val 8 Execute the corresponding train.py【 See later]
9 According to the parameters inside, it especially needs to be modified or checked: weight path; model/yolov5s.yaml; data/my_yolo5.yaml;   
10 resume parameter: If the machine restarts during the last training, you can default this parameter =True, execution will continue from where it was last interrupted.


=========================== training
home/user/TrainFile

train.y: home/user/TrainFile/yolov5_6./train.py
Before train.y: the data/my_yolo.yaml file needs to be modified: data and classification (number and category)
                         model/yolov5s.yaml file needs to be checked
    and data needs to be prepared The set/data set is placed in the home/mec/zyTrain/datasTrain/ directory

        --datasTrain
            --images
                ----train
                ----val
            --labels
                ----train
                ----val

Guess you like

Origin blog.csdn.net/qq_42835363/article/details/131645743