Last active
December 26, 2019 16:27
-
-
Save berak/62192bdb085df51803c675bfcd3c40c4 to your computer and use it in GitHub Desktop.
mace test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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