mirror of
https://github.com/opencv/opencv.git
synced 2024-11-30 14:29:49 +08:00
Merge pull request #20713 from SamFC10:unsqueeze-opset13
This commit is contained in:
commit
a4e2c56317
@ -1693,8 +1693,16 @@ void ONNXImporter::parseFlatten(LayerParams& layerParams, const opencv_onnx::Nod
|
||||
|
||||
void ONNXImporter::parseUnsqueeze(LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto)
|
||||
{
|
||||
CV_Assert(node_proto.input_size() == 1);
|
||||
DictValue axes = layerParams.get("axes");
|
||||
CV_Assert(node_proto.input_size() == 1 || node_proto.input_size() == 2);
|
||||
DictValue axes;
|
||||
if (node_proto.input_size() == 2)
|
||||
{
|
||||
Mat blob = getBlob(node_proto, 1);
|
||||
axes = DictValue::arrayInt(blob.ptr<int>(), blob.total());
|
||||
}
|
||||
else
|
||||
axes = layerParams.get("axes");
|
||||
|
||||
if (constBlobs.find(node_proto.input(0)) != constBlobs.end())
|
||||
{
|
||||
// Constant input.
|
||||
|
@ -605,6 +605,7 @@ TEST_P(Test_ONNX_layers, DynamicReshape)
|
||||
TEST_P(Test_ONNX_layers, Reshape)
|
||||
{
|
||||
testONNXModels("unsqueeze");
|
||||
testONNXModels("unsqueeze_opset_13");
|
||||
}
|
||||
|
||||
TEST_P(Test_ONNX_layers, Squeeze)
|
||||
|
Loading…
Reference in New Issue
Block a user