WongKinYiu / yolov9

Implementation of paper - YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information
GNU General Public License v3.0
8.97k stars 1.42k forks source link

how to train custom data #30

Closed cnjhh closed 8 months ago

WongKinYiu commented 8 months ago

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.

SkalskiP commented 8 months ago

Hi, @cnjhh and @WongKinYiu. I spent some time assembling this notebook. It shows how to:

@WongKinYiu I'd love to add this link to README.md, but I understand if you prefare not to. :)

WongKinYiu commented 8 months ago

Done.

SkalskiP commented 8 months ago

@WongKinYiu Thank you! 🙏🏻 I'm super honored. Maybe we could include a badge at the top of the README?

Colab

berengueradrian commented 8 months ago

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.

rmukh commented 8 months ago

@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. 

berengueradrian commented 8 months ago

All right, thanks for the info!

emilazborn commented 3 days ago

hello there. I wanted to know that this model is already trained? or I need to train it myself?