Closed JinhangZhu closed 4 years ago
Part 1: Understanding how YOLO works
How to implement a YOLO (v3) object detector from scratch in PyTorch: Part 1
详细:
在阅读了paper的基础上,增加理解了一些重要方法。比如在YOLO v2/v3中使用的anchor box方法。根据目标检测中的Anchor,YOLO使用的还是全局回归,在之后替换为anchor方法。这个方法是近期顶尖的目标检测方法都在使用的计数。
anchor box
首先预设一组不同尺度,不同位置的固定参考框,要覆盖几乎所有位置和尺度,每个参考框负责检测与其IoU大于阈值的目标。这个方法将ROI(这么理解可以么?)问题转换为“这个固定参考框中有无目标,目标的ground truth box偏离参考框多远”。
具体来说,训练阶段将anchor box作为训练样本,需要对每个anchor box标注两个标签:一是所含object的class,二是ground truth box对于anchor box的offset。接着根据预测的偏移量调整anchor box位置,得到预测边界框。最后一步reduce predicted bounding boxes,可以采用object confidence thresholding或者NMS。
anchor方法的好处是不需要多尺度遍历滑窗,真正实现了又好又快。使用了此方法的SOTA算法有如:Faster R-CNN(首发), SSD, YOLO v2, YOLO v3等。而在这之前,用来预测bounding box的方法有sliding window, selective search, region proposal...与anchor box相比较慢。
增加理解了网络组成和训练参数。这个主要关于input image从分成grid到每个cell在训练中所产生的tensor是怎么安排的,到围绕anchor box和bounding box的数量规则等,目前看来还是不够清晰,具体之后再手写来理解。
Simple preview of 博客作者使用的资源。使用的是paper作者提供的official weight file (用COCO dataset训练得到),可检测80个类。
当时还没有这个repo,所以计划不写进来。
Finished
Part 1: Understanding how YOLO works
详细:
在阅读了paper的基础上,增加理解了一些重要方法。比如在YOLO v2/v3中使用的
anchor box
方法。根据目标检测中的Anchor,YOLO使用的还是全局回归,在之后替换为anchor方法。这个方法是近期顶尖的目标检测方法都在使用的计数。首先预设一组不同尺度,不同位置的固定参考框,要覆盖几乎所有位置和尺度,每个参考框负责检测与其IoU大于阈值的目标。这个方法将ROI(这么理解可以么?)问题转换为“这个固定参考框中有无目标,目标的ground truth box偏离参考框多远”。
具体来说,训练阶段将anchor box作为训练样本,需要对每个anchor box标注两个标签:一是所含object的class,二是ground truth box对于anchor box的offset。接着根据预测的偏移量调整anchor box位置,得到预测边界框。最后一步reduce predicted bounding boxes,可以采用object confidence thresholding或者NMS。
anchor方法的好处是不需要多尺度遍历滑窗,真正实现了又好又快。使用了此方法的SOTA算法有如:Faster R-CNN(首发), SSD, YOLO v2, YOLO v3等。而在这之前,用来预测bounding box的方法有sliding window, selective search, region proposal...与anchor box相比较慢。
增加理解了网络组成和训练参数。这个主要关于input image从分成grid到每个cell在训练中所产生的tensor是怎么安排的,到围绕anchor box和bounding box的数量规则等,目前看来还是不够清晰,具体之后再手写来理解。
Simple preview of 博客作者使用的资源。使用的是paper作者提供的official weight file (用COCO dataset训练得到),可检测80个类。
Next
当时还没有这个repo,所以计划不写进来。