Is there some way to calculate anchor boxes for my own dataset?
mrlzla opened this issue · comments
I try to train this model on my own dataset. I created the structure of folder similar to kitti. I have the same size of image as KITTI. But my dataset has various sizes of objects and I think that anchors for KITTI doesn't fit it. F.e. there is a special script for YOLO v2 based on k-means to create anchors depends on train samples. Is there some way to calculate anchor boxes for my own dataset?
Can't you just use k-means on the boxes of your dataset?
Do we have to run k-means only on height and width parameters of GT bboxes for squeezeDet model?
I guess cx and cy are already being calculated in set_anchors method of kitti_squeezeDet_config.py. Please confirm!
@AndreaPisoni - can you please explain in more detail how the anchorse should be chosen using K-means, or give any link? Given I have W*H custom dataset, and X number of classes.
My current understanding is that I should run k-means on the size (W x H) of all gt-boxes, and then take top N (lets say 9 as in current config)?
EDIT: anchor generation is described here :https://arxiv.org/pdf/1606.01561.pdf. Basically run K-Means on width, and heights of boxes, where K is a hyperparameter but you can easily leave it as it is (9).