++train_cnt;
// Train only images for classes defined with MAX_TRAINING_CLASS.
- if (train_cnt == MAX_TRAINING_CLASS * SHOT_PER_CLASS - 1)
+ if (train_cnt == MAX_TRAINING_CLASS * SHOT_PER_CLASS)
break;
}
}
unsigned int test_cnt = 0;
- unsigned int positive_cnt = 0;
- unsigned int negative_cnt = 0;
+ unsigned int true_positive_cnt = 0;
+ unsigned int total_positive_cnt = 0;
+ unsigned int true_negative_cnt = 0;
+ unsigned int total_negative_cnt = 0;
while (!test_file.eof()) {
string filename, label, index;
auto it = find(cached_label.begin(), cached_label.end(), label);
if (it != cached_label.end()) {
- if (label == string(result.label))
- positive_cnt++;
+ total_positive_cnt++;
+
+ if (label == string(result.label))
+ true_positive_cnt++;
} else {
+ total_negative_cnt++;
+
if (ret == MEDIA_VISION_ERROR_NO_DATA)
- negative_cnt++;
+ true_negative_cnt++;
}
ret = mv_destroy_source(mv_source);
cout << "Positive test" << endl;
cout << "-------------" << endl;
- cout << "correct answer = " << positive_cnt++ << " / " << test_cnt / 2 << endl << endl;
+ cout << "correct answer = " << true_positive_cnt << " / " << total_positive_cnt << endl << endl;
cout << "Negative test" << endl;
cout << "-------------" << endl;
- cout << "correct answer = " << negative_cnt++ << " / " << test_cnt / 2 << endl;
+ cout << "correct answer = " << true_negative_cnt << " / " << total_negative_cnt << endl;
ret = mv_face_recognition_destroy(handle);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);