I am embarking on a project utilizing YOLOv9, initially trained on the COCO dataset’s 80 classes. My focus is on vehicle detection, specifically targeting four classes: cars, motorcycles, buses, and trucks. I intend to modify the YOLO architecture and the COCO dataset settings to include only these four classes, rather than filtering them out in the Python code. I plan to adjust the coco.yaml file to redefine class IDs as follows:
0: car
1: motorcycle
2: bus
3: truck
Could altering the class IDs in this way impact the pre-existing training on the COCO dataset? If this change necessitates retraining, could you guide me through the necessary steps?
Additionally, after adapting YOLOv9 to detect only these four vehicle classes, I aim to incorporate a new class, “van,” from a custom dataset I’ve prepared. This dataset includes the original four classes plus the new “van” class. I wish to retrain YOLOv9 on this new dataset without losing the pretrained COCO weights.
Could you provide detailed steps on how to:
Adjust the model and dataset settings for targeted retraining on the four specific classes?
Integrate and train on the new class while retaining the effectiveness of the COCO-pretrained weights?
I am quite new to this field and find some of these concepts confusing. Clear, step-by-step guidance would be greatly appreciated!
Thank you in advance for your assistance.
changed coco .yaml to :
0: car
1: motorcycle
2: bus
3: truck
changed nc variable to 4 in necessary files
prepared my custom dataset that contains the 4 classes + new class
Rama Abdlrahman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.