YOLOv2和YOLOv3的anchor大小有什么区别?

在YOLOv2中,作者用最后一层feature map的相对大小来定义anchor大小。也就是说,在YOLOv2中,输入图像大小为416*416,下采样32倍得到最后一层feature map大小为13X13,相对的anchor大小范围就在(0x0,13x13],如果一个anchor大小是9x9,那么其在原图上的实际大小应该放大32倍,就是288x288.

而在YOLOv3中,作者又改用相对于原图的大小来定义anchor,anchor的大小为(0x0,input_w x input_h]。需要注意的是,当你的训练集的大小不是416X416时,anchor应当是转换为416X416后的聚类结果。

所以,在两份cfg文件中,anchor的大小有明显的区别。如下是作者自己的解释:
So YOLOv2 I made some design choice errors, I made the anchor box size be relative to the feature size in the last layer. Since the network was down-sampling by 32. This means it was relative to 32 pixels so an anchor of 9x9 was actually 288px x 288px.

In YOLOv3 anchor sizes are actual pixel values. this simplifies a lot of stuff and was only a little bit harder to implement.

https://github.com/pjreddie/darknet/issues/555#issuecomment-376190325

猜你喜欢

转载自blog.csdn.net/z5217632/article/details/83995387