|
|
|
@ -81,12 +81,12 @@ class Test_TensorFlow_layers : public DNNTestLayer |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
void runTensorFlowNet(const std::string& prefix, bool hasText = false, |
|
|
|
|
double l1 = 0.0, double lInf = 0.0, bool memoryLoad = false) |
|
|
|
|
double l1 = 0.0, double lInf = 0.0, bool memoryLoad = false, const std::string& groupPrefix = "") |
|
|
|
|
{ |
|
|
|
|
std::string netPath = path(prefix + "_net.pb"); |
|
|
|
|
std::string netConfig = (hasText ? path(prefix + "_net.pbtxt") : ""); |
|
|
|
|
std::string netPath = path(prefix + groupPrefix + "_net.pb"); |
|
|
|
|
std::string netConfig = (hasText ? path(prefix + groupPrefix + "_net.pbtxt") : ""); |
|
|
|
|
std::string inpPath = path(prefix + "_in.npy"); |
|
|
|
|
std::string outPath = path(prefix + "_out.npy"); |
|
|
|
|
std::string outPath = path(prefix + groupPrefix + "_out.npy"); |
|
|
|
|
|
|
|
|
|
cv::Mat input = blobFromNPY(inpPath); |
|
|
|
|
cv::Mat ref = blobFromNPY(outPath); |
|
|
|
@ -975,10 +975,53 @@ TEST_P(Test_TensorFlow_layers, keras_mobilenet_head) |
|
|
|
|
runTensorFlowNet("keras_learning_phase"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TF case: align_corners=False, half_pixel_centers=False
|
|
|
|
|
TEST_P(Test_TensorFlow_layers, resize_bilinear) |
|
|
|
|
{ |
|
|
|
|
runTensorFlowNet("resize_bilinear"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TF case: align_corners=True, half_pixel_centers=False
|
|
|
|
|
TEST_P(Test_TensorFlow_layers, resize_bilinear_align_corners) |
|
|
|
|
{ |
|
|
|
|
runTensorFlowNet("resize_bilinear", |
|
|
|
|
false, 0.0, 0.0, false, // default parameters
|
|
|
|
|
"_align_corners"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TF case: align_corners=False, half_pixel_centers=True
|
|
|
|
|
TEST_P(Test_TensorFlow_layers, resize_bilinear_half_pixel) |
|
|
|
|
{ |
|
|
|
|
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH) |
|
|
|
|
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); |
|
|
|
|
|
|
|
|
|
runTensorFlowNet("resize_bilinear", false, 0.0, 0.0, false, "_half_pixel"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TF case: align_corners=False, half_pixel_centers=False
|
|
|
|
|
TEST_P(Test_TensorFlow_layers, resize_bilinear_factor) |
|
|
|
|
{ |
|
|
|
|
runTensorFlowNet("resize_bilinear_factor"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TF case: align_corners=False, half_pixel_centers=True
|
|
|
|
|
TEST_P(Test_TensorFlow_layers, resize_bilinear_factor_half_pixel) |
|
|
|
|
{ |
|
|
|
|
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH) |
|
|
|
|
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); |
|
|
|
|
|
|
|
|
|
runTensorFlowNet("resize_bilinear_factor", false, 0.0, 0.0, false, "_half_pixel"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TF case: align_corners=True, half_pixel_centers=False
|
|
|
|
|
TEST_P(Test_TensorFlow_layers, resize_bilinear_factor_align_corners) |
|
|
|
|
{ |
|
|
|
|
runTensorFlowNet("resize_bilinear_factor", false, 0.0, 0.0, false, "_align_corners"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TF case: align_corners=False, half_pixel_centers=False
|
|
|
|
|
TEST_P(Test_TensorFlow_layers, resize_bilinear_down) |
|
|
|
|
{ |
|
|
|
|
runTensorFlowNet("resize_bilinear_down"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|