1 | initial version |
not really an answer to your question, but you really should try the new, pretrained openface dnn:
dnn::Net net = dnn::readNetFromTorch("openface.nn4.small2.v1.t7");
Mat image = ... // color image !
Mat inputBlob = dnn::blobFromImage(image, 1./255, Size(96,96), Scalar(), true, false);
net.setInput(inputBlob);
Mat feature = net.forward().clone();
then just compare features from images, using either a straight L2 norm(like in the paper)
double dist = norm(feature1, feature2);
or any ml algorithm you like.