yolov9
yolov9 copied to clipboard
how to train custom data
Make sure your dataset has same format as provided format for coco dataset. Modify the coco.yaml and yolov9.yaml to fit your dataset. Then you can train your custom data.
Hi, @cnjhh and @WongKinYiu. I spent some time assembling this notebook. It shows how to:
- Run inference with a pre-trained model
- Fine-tune models on custom dataset
- Evaluate fine-tuned model
- Run inference with fine-tuned model
@WongKinYiu I'd love to add this link to README.md
, but I understand if you prefare not to. :)
Done.
@WongKinYiu Thank you! 🙏🏻 I'm super honored. Maybe we could include a badge at the top of the README?
Hi @WongKinYiu @SkalskiP, is there any way to perform fine-tuning on the model using a custom dataset with different structure than the one used in the Colab(YOLO structure)?
I want to use it for a dataset with a different structure and I would like to know if you have some hints on how to carry this out. I have a lot of data and it is not efficient for me to transform that bunch of data into the YOLO structure, I would like to have a 'general' approach in order to be able to train it with different dataset structures. My structure is in this case is:
├── src
│ ├── images
│ │ ├── <class_directory>/<image>.jpg
│ ├── bounding_boxes.txt
│ ├── classes.txt
│ ├── image_class_labels.txt
│ ├── images.txt
│ ├── train_test_splits.txt
Thanks in advance.
@berengueradrian I guess it is not possible to create a 'general approach' that supports all possible user's dataset structures. That's why we have different data formats (COCO, YOLO, etc). The code can be refactored to expect the user's dataloader, but it would take some time to properly refactor. So, I guess you can use your own custom dataloader and insert it here https://github.com/WongKinYiu/yolov9/blob/380284cb66817e9ffa30a80cad4c1b110897b2fb/train.py#L177 Just make sure your dataloader outputs the data in the expected format.
All right, thanks for the info!