mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
allow null constant_value in Pad and ignore it when loading
This commit is contained in:
parent
88cacd35c5
commit
4f99e5ab37
@ -2605,7 +2605,8 @@ void ONNXImporter::parsePad(LayerParams& layerParams, const opencv_onnx::NodePro
|
||||
paddings = paddings.t();
|
||||
layerParams.set("paddings", DictValue::arrayInt(paddings.ptr<int>(), paddings.total()));
|
||||
|
||||
if (node_proto.input_size() == 3)
|
||||
// check for non-null constant_value
|
||||
if (node_proto.input_size() == 3 && !node_proto.input(2).empty())
|
||||
{
|
||||
Mat value = getBlob(node_proto, 2);
|
||||
float padValue = (depth == CV_8S) ? (float)value.ptr<int8_t>()[0] : value.ptr<float>()[0];
|
||||
|
Loading…
Reference in New Issue
Block a user