So I have just recently started exploring machine learning, and for a project I was required to train the YOLO v5 model. I first tried it on the coco128 dataset:https://www.kaggle.com/ultralytics/coco128..
repository of the yolo v5: https://github.com/ultralytics/yolov5
I followed this tutorial: https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data step by step and managed to train the model succesfully, it is detecting objects as I intended it to do.
I wanted to have a very basic overview an what is basically happening when we are "training" the model.
The command used for training was:
python train.py --img 640 --batch 16 --epochs 5 --data coco128.yaml --weights yolov5s.pt
From what I understand, this tells the command line to run the file "train.py" (which uses argeparse library) with the following arguments: 640 (image size), 16 (batch size for batch gradient descent), 5 (no. of epochs), coco128.yaml (the config file), and yolov5s.pt (the weights file).
Doubts
- The tutorial mentions that the weights are pretrained. This is confusing me because I thought the entire objective of "training" a model is to find the correct weights for the parameters. If the weights are already supplied, what exactly is the training achieving? It has been fed a bunch of images along with the labels for the bounding boxes for that images. What does it do with these images and labels to become capable of predicting objects?
- The coco128.yaml mentions a path for the "validation" folder. What exactly is a "validation" folder used for?