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

Custom Data and AutoAnchors #98

Open
nikhilchh opened this issue Nov 3, 2023 · 0 comments
Open

Custom Data and AutoAnchors #98

nikhilchh opened this issue Nov 3, 2023 · 0 comments

Comments

@nikhilchh
Copy link

nikhilchh commented Nov 3, 2023

I have my custom dataset so I thought calculating data specific anchors is a better idea. (using kmean_anchors).

These are the 8 values I got based on my data:
32,32, 108,195, 196,229, 159,348, 260,328, 359,317, 281,518, 509,424​

I have few questions:
1- The kmeans_anchor algorithm calculates these anchors without actually doing the augmentations. Not sure if that is a good idea. What do u think ? Its currently calculated based on distribution of (width,height) of pure training data (without augmentations).
2- How should I assign these anchors to different grid ? I guess particular size of anchor boxes are more suitable to specific grid. Latest yolo5s.yaml uses three set of grids instead of 4. So I decided to use that and this is how it looks like.
image

I added an extra 20,20 anchor to make the total of 9 anchors. Do you think this is optimal ? I am still training the model.

3- If I only want to use 6 anchors:
32,32,  122,195,  165,314,  281,311,  281,473,  483,403
Which grid size should I skip and what to remove from head section of yolo.yaml file ?

4- Can I use a pre-trained model which was trained with different anchor boxes ? OR should I train from scratch whenever I come up with new anchors?

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

1 participant