Hi Tewodros,
I understand you have a custom dataset and you want to train a YOLO Detector. To train a YOLO v4 object detection network on a labeled data set, use the "trainYOLOv4ObjectDetector" function.
Firstly you must specify the class names for the data set you intend to use to train the network. Then, train an untrained or pretrained network by using the "trainYOLOv4ObjectDetector" function. The training function returns the trained network as a "yolov4ObjectDetector" object.
openExample('vision/TrainYOLOV4NetworkForVehicleDetectionExample')
Make sure you have the following installations beforehand:
- MATLAB® R2022a or later
- Deep Learning Toolbox
- Computer Vision Toolbox
The training process in the example mostly consists of 3 main parts:
1- Prepare Training Data:
- Prepare data which can be loaded as a table with the first column containing the training images filepath and the second column containing the labeled bounding boxes coordinates.
- Also specify the input size to use for resizing the training images
2- Estimate Anchor Boxes:
3- Configure and Train Yolov4 network:
- Specify the class names.
- Configure the pretrained YOLO v4 deep learning network to be retrained for the new dataset by using "yolov4ObjectDetector" function.In the example it has used "tiny-yolov4-coco" as the pretrained model.
- Finally specify the training options and retrain the pretrained YOLO v4 network on the new dataset.
Hope this helps.