Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to train custom data #30

Closed
cnjhh opened this issue Feb 23, 2024 · 7 comments
Closed

how to train custom data #30

cnjhh opened this issue Feb 23, 2024 · 7 comments

Comments

@cnjhh
Copy link

cnjhh commented Feb 23, 2024

No description provided.

@WongKinYiu
Copy link
Owner

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
Copy link

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. :)

@WongKinYiu
Copy link
Owner

Done.

@SkalskiP
Copy link

SkalskiP commented Feb 23, 2024

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

Colab

@berengueradrian
Copy link

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
Copy link

rmukh commented Mar 7, 2024

@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

yolov9/train.py

Line 177 in 380284c

train_loader, dataset = create_dataloader(train_path,

Just make sure your dataloader outputs the data in the expected format. 

@berengueradrian
Copy link

All right, thanks for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants