mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Merge pull request #18316 from sl-sergei:fix_18253
Fix loading of ONNX models with Resize operation with Opset 11 for newer versions of Pytorch * Add reproducer for Resize operation from newer versions of Pytorch * Fix loading of scales parameter for Resize layer * Change check type for better diagnostic messages
This commit is contained in:
parent
540982cc9d
commit
fa953e4205
@ -1588,7 +1588,9 @@ void ONNXImporter::populateNet(Net dstNet)
|
||||
Mat shapes = getBlob(node_proto, constBlobs, node_proto.input_size() - 1);
|
||||
CV_CheckEQ(shapes.size[0], 4, "");
|
||||
CV_CheckEQ(shapes.size[1], 1, "");
|
||||
CV_CheckTypeEQ(shapes.depth(), CV_32S, "");
|
||||
CV_CheckDepth(shapes.depth(), shapes.depth() == CV_32S || shapes.depth() == CV_32F, "");
|
||||
if (shapes.depth() == CV_32F)
|
||||
shapes.convertTo(shapes, CV_32S);
|
||||
int height = shapes.at<int>(2);
|
||||
int width = shapes.at<int>(3);
|
||||
if (node_proto.input_size() == 3)
|
||||
|
@ -636,6 +636,11 @@ TEST_P(Test_ONNX_layers, MatmulWithTwoInputs)
|
||||
testONNXModels("matmul_with_two_inputs");
|
||||
}
|
||||
|
||||
TEST_P(Test_ONNX_layers, ResizeOpset11_Torch1_6)
|
||||
{
|
||||
testONNXModels("resize_opset11_torch1.6");
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(/*nothing*/, Test_ONNX_layers, dnnBackendsAndTargets());
|
||||
|
||||
class Test_ONNX_nets : public Test_ONNX_layers
|
||||
|
Loading…
Reference in New Issue
Block a user