参考:
https://www.zhihu.com/question/308366100
https://www.pythonheidong.com/blog/article/409533/
1、根据自己的数据集重新计算anchor值
官网或者AlexeyAB的yolov3.cfg中,都是是3个检测尺度共9个anchors,但是不同数据库的anchors值不一样,如果只用默认的anchor值,会造成检测框不精确,所以对于自训练模型来说,根据自身数据集或者网络的特征尺度的修改情况,来修改anchor值。
anchor值是使用k-means聚类算法计算所得。
通过查阅相关资料,有2种python脚本可以实现。只是我还没有运行,不知道效果。先把链接贴上。(证实后再来反馈)
https://blog.youkuaiyun.com/weixin_42880443/article/details/81953158
https://github.com/PaulChongPeng/darknet/tree/master/tools
https://blog.youkuaiyun.com/andeyeluguo/article/details/89230914