mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge pull request #16424 from czgdp1807:issue-16370
* fixed Split layer in ONNXImporter * added test for fix of split layer * fixed tests for Split layer * applied reviews * updated tests * fixed paths in tests
This commit is contained in:
@@ -485,16 +485,23 @@ void ONNXImporter::populateNet(Net dstNet)
|
||||
}
|
||||
else if (layer_type == "Split")
|
||||
{
|
||||
DictValue splits = layerParams.get("split");
|
||||
const int numSplits = splits.size();
|
||||
CV_Assert(numSplits > 1);
|
||||
|
||||
std::vector<int> slicePoints(numSplits - 1, splits.get<int>(0));
|
||||
for (int i = 1; i < splits.size() - 1; ++i)
|
||||
if (layerParams.has("split"))
|
||||
{
|
||||
slicePoints[i] = slicePoints[i - 1] + splits.get<int>(i - 1);
|
||||
DictValue splits = layerParams.get("split");
|
||||
const int numSplits = splits.size();
|
||||
CV_Assert(numSplits > 1);
|
||||
|
||||
std::vector<int> slicePoints(numSplits - 1, splits.get<int>(0));
|
||||
for (int i = 1; i < splits.size() - 1; ++i)
|
||||
{
|
||||
slicePoints[i] = slicePoints[i - 1] + splits.get<int>(i - 1);
|
||||
}
|
||||
layerParams.set("slice_point", DictValue::arrayInt(&slicePoints[0], slicePoints.size()));
|
||||
}
|
||||
else
|
||||
{
|
||||
layerParams.set("num_split", node_proto.output_size());
|
||||
}
|
||||
layerParams.set("slice_point", DictValue::arrayInt(&slicePoints[0], slicePoints.size()));
|
||||
layerParams.type = "Slice";
|
||||
}
|
||||
else if (layer_type == "Add" || layer_type == "Sum")
|
||||
|
||||
Reference in New Issue
Block a user