提交 05db8784 编写于 作者: S Smirnov Egor

fix Clip, LeakyReLU, LRN, Split defaults

上级 a6277370
......@@ -80,7 +80,7 @@ public:
if (size % 2 != 1 || size <= 0)
CV_Error(Error::StsBadArg, "LRN layer supports only positive odd values for local_size");
alpha = params.get<double>("alpha", 1);
alpha = params.get<double>("alpha", 0.0001);
beta = params.get<double>("beta", 0.75);
bias = params.get<double>("bias", 1);
normBySize = params.get<bool>("norm_by_size", true);
......
......@@ -920,6 +920,7 @@ void ONNXImporter::parseSplit(LayerParams& layerParams, const opencv_onnx::NodeP
layerParams.set("num_split", node_proto.output_size());
}
layerParams.type = "Slice";
layerParams.set("axis", layerParams.get<float>("axis", 0));
addLayer(layerParams, node_proto);
}
......@@ -1184,15 +1185,15 @@ void ONNXImporter::parseImageScaler(LayerParams& layerParams, const opencv_onnx:
void ONNXImporter::parseClip(LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto)
{
layerParams.type = "ReLU6";
replaceLayerParam(layerParams, "min", "min_value");
replaceLayerParam(layerParams, "max", "max_value");
layerParams.set("min_value", layerParams.get<float>("min", -FLT_MAX));
layerParams.set("max_value", layerParams.get<float>("max", FLT_MAX));
addLayer(layerParams, node_proto);
}
void ONNXImporter::parseLeakyRelu(LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto)
{
layerParams.type = "ReLU";
replaceLayerParam(layerParams, "alpha", "negative_slope");
layerParams.set("negative_slope", layerParams.get<float>("alpha", 0.01));
addLayer(layerParams, node_proto);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册