mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 11:45:30 +08:00
Merge pull request #23707 from Orange-OpenSource:ONNX_Squeeze_negative_index_for_the_axes_attribute
Addition of normalize_axis to ONNXImporter::parseSqueeze
This commit is contained in:
commit
c55aee1e79
@ -2147,6 +2147,7 @@ void ONNXImporter::parseSqueeze(LayerParams& layerParams, const opencv_onnx::Nod
|
||||
for (int i = 0; i < axes_dict.size(); ++i)
|
||||
{
|
||||
int axis = axes_dict.getIntValue(i);
|
||||
axis = normalize_axis(axis, inpShape.size());
|
||||
CV_CheckLE(axis, static_cast<int>(inpShape.size()), "Squeeze axis");
|
||||
maskedAxes[axis] = inpShape[axis] == 1;
|
||||
}
|
||||
@ -2162,6 +2163,7 @@ void ONNXImporter::parseSqueeze(LayerParams& layerParams, const opencv_onnx::Nod
|
||||
for (int i = 0; i < axesLen; i++)
|
||||
{
|
||||
int axis = axesMat.at<int>(i);
|
||||
axis = normalize_axis(axis, inpShape.size());
|
||||
CV_CheckLE(axis, static_cast<int>(inpShape.size()), "Squeeze axis");
|
||||
maskedAxes[axis] = inpShape[axis] == 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user