mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
Added tests for ResNet-50 and SqueezeNet v1.1
This commit is contained in:
parent
d5323ce848
commit
d3c14ce3ea
@ -157,4 +157,35 @@ TEST(Reproducibility_SSD, Accuracy)
|
||||
Mat ref = blobFromNPY(_tf("ssd_out.npy"));
|
||||
normAssert(ref, out);
|
||||
}
|
||||
|
||||
TEST(Reproducibility_ResNet50, Accuracy)
|
||||
{
|
||||
Net net = readNetFromCaffe(findDataFile("dnn/ResNet-50-deploy.prototxt", false),
|
||||
findDataFile("dnn/ResNet-50-model.caffemodel", false));
|
||||
|
||||
Mat input = blobFromImage(imread(_tf("googlenet_0.png")), 1, Size(224,224));
|
||||
ASSERT_TRUE(!input.empty());
|
||||
|
||||
net.setInput(input);
|
||||
Mat out = net.forward();
|
||||
|
||||
Mat ref = blobFromNPY(_tf("resnet50_prob.npy"));
|
||||
normAssert(ref, out);
|
||||
}
|
||||
|
||||
TEST(Reproducibility_SqueezeNet_v1_1, Accuracy)
|
||||
{
|
||||
Net net = readNetFromCaffe(findDataFile("dnn/squeezenet_v1.1.prototxt", false),
|
||||
findDataFile("dnn/squeezenet_v1.1.caffemodel", false));
|
||||
|
||||
Mat input = blobFromImage(imread(_tf("googlenet_0.png")), 1, Size(227,227));
|
||||
ASSERT_TRUE(!input.empty());
|
||||
|
||||
net.setInput(input);
|
||||
Mat out = net.forward();
|
||||
|
||||
Mat ref = blobFromNPY(_tf("squeezenet_v1.1_prob.npy"));
|
||||
normAssert(ref, out);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -104,8 +104,8 @@ TEST(Reproducibility_ResNet_50_Halide, Accuracy)
|
||||
|
||||
TEST(Reproducibility_SqueezeNet_v1_1_Halide, Accuracy)
|
||||
{
|
||||
test(findDataFile("dnn/squeezenet_v1_1.caffemodel", false),
|
||||
findDataFile("dnn/squeezenet_v1_1.prototxt", false),
|
||||
test(findDataFile("dnn/squeezenet_v1.1.caffemodel", false),
|
||||
findDataFile("dnn/squeezenet_v1.1.prototxt", false),
|
||||
findDataFile("dnn/halide_scheduler_squeezenet_v1_1.yml", false),
|
||||
227, 227, "prob", "caffe", DNN_TARGET_CPU);
|
||||
};
|
||||
@ -151,8 +151,8 @@ TEST(Reproducibility_ResNet_50_Halide_opencl, Accuracy)
|
||||
|
||||
TEST(Reproducibility_SqueezeNet_v1_1_Halide_opencl, Accuracy)
|
||||
{
|
||||
test(findDataFile("dnn/squeezenet_v1_1.caffemodel", false),
|
||||
findDataFile("dnn/squeezenet_v1_1.prototxt", false),
|
||||
test(findDataFile("dnn/squeezenet_v1.1.caffemodel", false),
|
||||
findDataFile("dnn/squeezenet_v1.1.prototxt", false),
|
||||
findDataFile("dnn/halide_scheduler_opencl_squeezenet_v1_1.yml", false),
|
||||
227, 227, "prob", "caffe", DNN_TARGET_OPENCL);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user