Commit 94552d96 authored by Pavel Rojtberg's avatar Pavel Rojtberg

update test to actually available testdata.

note that reference was merely regenerated, not verified.
parent 7157e674
......@@ -30,7 +30,7 @@ void CV_CNN_Feature_Test::run(int)
String network_forIMG = cvtest::TS::ptr()->get_data_path() + "3d_triplet_testIMG.prototxt";
String mean_file = "no";
std::vector<String> ref_img;
String target_img = String(ts->get_data_path()) + "1_8.png";
String target_img = String(ts->get_data_path()) + "4_78.png";
String feature_blob = "feat";
String device = "CPU";
int dev_id = 0;
......@@ -43,15 +43,16 @@ void CV_CNN_Feature_Test::run(int)
return;
}
cv::cnn_3dobj::descriptorExtractor descriptor(device, dev_id);
if (strcmp(mean_file.c_str(), "no") == 0)
if (mean_file == "no")
descriptor.loadNet(network_forIMG, caffemodel);
else
descriptor.loadNet(network_forIMG, caffemodel, mean_file);
cv::Mat feature_test;
descriptor.extract(img_base, feature_test, feature_blob);
Mat feature_reference = (Mat_<float>(1,16) << -134.03548, -203.48265, -105.96752, 55.343075, -211.36378, 487.85968, -182.15063, 62.229042, 297.19876, 206.07578, 291.74951, -19.906454, -464.09152, 135.79895, 420.43616, 2.2887282);
printf("Reference feature is computed by Caffe extract_features tool by \n To generate values for different images, use extract_features \n with the resetted image list in prototxt.");
// Reference feature is computed by Caffe extract_features tool.
// To generate values for different images, use extract_features with the resetted image list in prototxt.
Mat feature_reference = (Mat_<float>(1,3) << -312.4805, 8.4768486, -224.98953);
float dist = norm(feature_test - feature_reference);
if (dist > 5) {
ts->printf(cvtest::TS::LOG, "Extracted featrue is not the same from the one extracted from Caffe.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment