'write_bbox': Draw a rectangle with a colour. Also creates a filled rectangle on the top left corner with the class of the object detected in the bounding box.
'letterbox_image': Resize image with unchanged aspect ratio using padding.
'prep_image': Prepare image for inputting to the neural network. Transforming from numpy to tensor.
Done
4.6 - 4.7
[x] 加载weights文件。首先了解了官方的
yolov3.weights
文件是如何存放weights和bias参数的,注意:1) 只有卷积层有权重或bias会保存起来其他层没有;2)Batch norm是属于卷积层的但也不是所有卷积层都有BN。函数定义:def load_weights(self, weight_file)。当然,加载weights file是为了存入model的,这个函数设计成类的method。
yolov3.weights
结构:how-weights-stored.png[x] 筛选Bounding boxes。依次通过Objectness confidence thresholding和Class score NMS来减少边界框的数量,前者是YOLO的一个创新点,具体❓为什么合理待分析。
4.8
detection
,也就是一次前向传递 (Forward pass),并没有涉及training
和testing
,不过以我目前的认识,这两步也不是很难了,主要是训练需要看如何定义loss function,这个问题在论文中有很专门的解释,虽然有总结但loss是一笔带过的,有❓问题再看了。学到的新的有用的一些函数:
arg_parse
: Parse arguments to detect module.两个有意思的检测结果:
YOLOv3在COCO数据集对
person
类检测很完善了,我做手检测的话专门的数据集应该更好些,这个可以到时候比较比较🔨。如果游戏人物的检测呢?比如说到时候设计虚拟现实的第一人称手部检测❓布里吉塔的衣服都识别成摩托了。