Added ngraph::op::v4::Interpolation#19716
Merged
opencv-pushbot merged 2 commits intoopencv:3.4from Mar 13, 2021
Merged
Conversation
alalek
reviewed
Mar 12, 2021
modules/dnn/src/layers/mvn_layer.cpp
Outdated
| #if INF_ENGINE_VER_MAJOR_LE(INF_ENGINE_RELEASE_2021_2) | ||
| auto mvn = std::make_shared<ngraph::op::MVN>(ieInpNode, acrossChannels, normVariance, eps); | ||
| #else | ||
| int64_t start_axis = 1 + !acrossChannels; |
Member
There was a problem hiding this comment.
I believe this should be more clear:
int64_t start_axis = acrossChannels ? 1 : 2;
| auto out_shape = std::make_shared<ngraph::op::Constant>(ngraph::element::i64, ngraph::Shape{2}, shape.data()); | ||
|
|
||
| auto& input_shape = ieInpNode->get_shape(); | ||
| std::vector<float> scales = {static_cast<float>(outHeight) / input_shape[2], static_cast<float>(outHeight) / input_shape[2]}; |
Member
There was a problem hiding this comment.
Please add CV_Assert(input_shape[2] != 0); before division.
Also it makes sense to evaluate static_cast<float>(outHeight) / input_shape[2] only once.
| attrs.mode = ngraph::op::v4::Interpolate::InterpolateMode::linear_onnx; | ||
| attrs.coordinate_transformation_mode = ngraph::op::v4::Interpolate::CoordinateTransformMode::asymmetric; | ||
| } else { | ||
| CV_Error(Error::StsNotImplemented, "Unsupported interpolation: " + interpolation); |
Member
There was a problem hiding this comment.
Please use cv::format()` here.
Old compilers may not like const char* operations.
Also it would lead to error if someone converts interpolation to int/enum in the future (code would compile w/o errors and const char* pointer arithmetic would be applied here)
alalek
approved these changes
Mar 13, 2021
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.