Skip to content

Instantly share code, notes, and snippets.

@berak
Last active December 26, 2019 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berak/62192bdb085df51803c675bfcd3c40c4 to your computer and use it in GitHub Desktop.
Save berak/62192bdb085df51803c675bfcd3c40c4 to your computer and use it in GitHub Desktop.
mace test
// images from
// https://drive.google.com/drive/folders/19tcwtgXRqyRxcNcfmyqUoBPM78mvfD9n?usp=sharing
int main(int argc, char **argv) {
Ptr<MACE> mace = MACE::create();
vector<string> fn;
glob("face",fn);
for (int i=0; i<fn.size(); i++) {
vector<Mat> train_img;
for (int j=0; j<fn.size(); j++) {
if (i==j) continue;
Mat img = imread(fn[j], 0);
train_img.push_back(img);
}
mace->train(train_img);
Mat img = imread(fn[i], 0);
bool same = mace->same(img);
cout << i << " : " << same << endl;
}
return 0;
}
/*
0 : 0
1 : 1
2 : 1
3 : 0
4 : 0
5 : 1
6 : 0
7 : 0
8 : 1
9 : 0
*/
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment