darknet mask and anchor values for yolov4

Viewed 2073

In the README.md of darknet repo https://github.com/AlexeyAB/darknet we have this sentence about anchor boxes:

But you should change indexes of anchors masks= for each [yolo]-layer, so for YOLOv4 the 1st-[yolo]-layer has anchors smaller than 30x30, 2nd smaller than 60x60, 3rd remaining.

It looks like the default anchor boxes for yolov4-sam-mish.cfg are 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401

and the first yolo layer has config:

mask = 0,1,2

Do I understand correctly that this will use those anchors?

(12, 16), (19, 36), (40, 28)

If yes it seems to contradict with the statement or do I understand it incorrectly.

I'm asking because for my dataset and my image sizes (256, 96) I got those anchors from calc_anchors in darknet

15, 56, 22, 52, 28, 48, 23, 62, 26, 59, 39, 43, 31, 57, 29, 66, 37, 64

and trying to figure out how should I set the masks.

1 Answers
Related