InsightFace中在人脸检测使用了MTCNN,那使用的版本是v1还是v2没有提及,搜索未果。
自己查询了MTCNN源码发现v1和v2的区别就在于v2是对v1的一个扩充
原文如下:
'MTCNNv1' is an implementation of our 'Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks' paper.
'MTCNNv2' is an extended version (using iamge patch around each landmark outputted from stage 3 to make a precise regression).
v2只是v1的基础上在stage3对landmark作了一个精确回归,具体在MTCNNv2的bbrg.m中实现
function [boundingbox] = bbreg(boundingbox,reg)
%calibrate bouding boxes
if size(reg,2)==1
reg=reshape(reg,[size(reg,3) size(reg,4)])';
end
w=[boundingbox(:,3)-boundingbox(:,1)]+1;
h=[boundingbox(:,4)-boundingbox(:,2)]+1;
boundingbox(:,1:4)=[boundingbox(:,1)+reg(:,1).*w boundingbox(:,2)+reg(:,2).*h boundingbox(:,3)+reg(:,3).*w boundingbox(:,4)+reg(:,4).*h];
end