mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
Merge pull request #25660 from Abdurrahheem:ash/fix-slice-empty-input
Slice layer parser fix to support empty input case #25660 This PR fixes Slice Layer's parser to handle empty input cases (cases with initializer) It fixed the issue rased in #24838 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
parent
f4ebf7c0a6
commit
d7f04a9d33
@ -1202,7 +1202,12 @@ void ONNXImporter::parseReduce(LayerParams& layerParams, const opencv_onnx::Node
|
||||
|
||||
void ONNXImporter::parseSlice(LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto)
|
||||
{
|
||||
MatShape inpShape = outShapes[node_proto.input(0)];
|
||||
MatShape inpShape;
|
||||
if (constBlobs.find(node_proto.input(0)) != constBlobs.end())
|
||||
inpShape = shape(getBlob(node_proto, 0));
|
||||
else {
|
||||
inpShape = outShapes[node_proto.input(0)];
|
||||
}
|
||||
int dims = inpShape.size();
|
||||
std::vector<int> begin(dims, 0);
|
||||
std::vector<int> end(dims, INT_MAX);
|
||||
|
Loading…
Reference in New Issue
Block a user