Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ujjayant-kadian
Copy link
Contributor

@ujjayant-kadian ujjayant-kadian commented May 28, 2024

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@ujjayant-kadian
Copy link
Contributor Author

Added a new member function cfgParamsMap that allows setting multiple configuration options for the OpenVINO Execution Provider by passing a map of key-value pairs, where the key is the name of the option and the value is the setting for that option. The function will throw an error if an attempt is made to set an option that has already been set or if an unknown option is provided.

Copy link
Contributor

@TolyaTalamanov TolyaTalamanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

One suggestion here, most probably it's better to introduce another ctor that accepts the map rather than new handle. In that case we could prohibit using the cfg handles.

auto ovep = cv::gapi::onnx::ep::OpenVINO({"device_type", "CPU"}, {...}});
ovep.cfgNumThreads(4) // Throw: ep::OpenVINO cannot be changed if created from the parameters map.

and at the backend side we could simply check if parameters_map is empty or not, and if not - pass it "as-is" to onnxrt, otherwise populate it by using existing per-option members.

Copy link
Contributor

@TolyaTalamanov TolyaTalamanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Just minor comments!

Copy link
Contributor

@TolyaTalamanov TolyaTalamanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM 👍

@dmatveev Could you have a look, please?

@dmatveev dmatveev self-assigned this May 31, 2024
@dmatveev
Copy link
Contributor

👍I am fine with it, thanks @ujjayant-kadian !

@TolyaTalamanov
Copy link
Contributor

@asmorkalov Could you merge this, please?

@asmorkalov asmorkalov modified the milestone: 4.10.0 May 31, 2024
@asmorkalov asmorkalov merged commit dcce2b8 into opencv:4.x May 31, 2024
@ujjayant-kadian ujjayant-kadian deleted the uk/port-gapi-onnxrt-backend-into-v2-api branch May 31, 2024 14:02
@mshabunin mshabunin mentioned this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants