LeslieZhoa / tensorflow-MTCNN

人脸检测MTCNN算法,采用tensorflow框架编写,从理解到训练,中文注释完全,含测试和训练,支持摄像头

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问boundbox_regression输出的四个值,是关于【左上角坐标,宽,高】的,还是【左上角坐标,右下角坐标】的?代码貌似和论文不一致,求教。

nbl97 opened this issue · comments

请问boundbox_regression输出的四个值,是关于【左上角坐标,宽,高】的,还是【左上角坐标,右下角坐标】的?代码貌似和论文不一致,求教。

看detection目录下的MtcnnDetector.py中的这部分代码可能会有帮助,大概在262-275行。

` # 偏移量
dx1, dy1, dx2, dy2 = [reg[t_index[0], t_index[1], i] for i in range(4)]

    reg = np.array([dx1, dy1, dx2, dy2])
    score = cls_map[t_index[0], t_index[1]]
    #对应原图的box坐标,分类分数,box偏移量
    boundingbox = np.vstack([np.round((stride * t_index[1]) / scale),
                             np.round((stride * t_index[0]) / scale),
                             np.round((stride * t_index[1] + cellsize) / scale),
                             np.round((stride * t_index[0] + cellsize) / scale),
                             score,
                             reg])
    #shape[n,9]
    return boundingbox.T `