note1:
读代码的阶段来说,自己感觉已经能有一定的python函数基础,开始对代码内部的策略进行理解,因为bbox为fast-rcnn代码,只是简单的介绍了一下。对rpn_msr进行一定的详细策略解析。主要在对代码算法理解层面。
bbox笔记:
两个程序是用Cython写的,好处是速度快,但因为要用到cython涉及编译问题,所以编译比较麻烦。在作者的issue里找到了对应的py文件,作为参看。这两个nms.py和bbox.py是一个通用的,大部分的代码上都是相同的。先附上对应代码:
#the py for nms
import numpy as np
def nms(dets, thresh):
x1 = dets[:, 0]
y1 = dets[:, 1]
x2 = dets[:, 2]
y2 = dets[:, 3]
scores = dets[:, 4]
areas = (x2 - x1 + 1) * (y2 - y1 + 1)
order = scores.argsort()[::-1]
keep = []
while order.size > 0:
i = order[0]
keep.append(i)
xx1 = np.maximum(x1[i], x1[order[1:]])
yy1 = np.maximum(y1[i], y1[order