G-API: Support OpenVINO Execution Provider for ONNXRT Backend#24024
Conversation
bbc17ed to
b817d4d
Compare
| options.num_of_threads = *ovep.num_of_threads; | ||
| } | ||
|
|
||
| session_options->AppendExecutionProvider_OpenVINO(options); |
There was a problem hiding this comment.
This thing might throw, make sense to wrap it and show the understandable error message...
| session_options->AppendExecutionProvider_OpenVINO(options); | ||
| } catch (const std::exception &e) { | ||
| std::stringstream ss; | ||
| ss << "ONNX Backend: Failed to enable OpenVINO Execution Provider: " |
There was a problem hiding this comment.
Usually throw when onnxruntime_providers_openvino can't be found.
|
@dmatveev Could you have a look, please? |
|
The open question is how it can be tested because it requires |
| void run(); | ||
| }; | ||
|
|
||
| static void appendExecutionProvider(Ort::SessionOptions *session_options, |
There was a problem hiding this comment.
hmm, you actually make a good point, what if it's possible to use multiple execution providers at the same time...
In that case I'd probably need to hold the list of them.
There was a problem hiding this comment.
| namespace ep = cv::gapi::onnx::ep; | ||
| switch (execution_provider.index()) { | ||
| case ep::EP::index_of<ep::OpenVINO>(): { | ||
| GAPI_LOG_INFO(NULL, "OpenVINO Execution Provider is selected."); |
There was a problem hiding this comment.
Maybe it makes sense to display for which network (if it is not mentioned in the log earlier).
There was a problem hiding this comment.
As an option, yes
| default: | ||
| break; |
There was a problem hiding this comment.
Any message for this case?
There was a problem hiding this comment.
I think some sort of log would be useful
|
Tested manually with openvino_toolkit_ubuntu18_2022.1.1.7030.39aba80957e. |
…ino-execution-provider G-API: Support OpenVINO Execution Provider for ONNXRT Backend opencv#24024 ### 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
…ino-execution-provider G-API: Support OpenVINO Execution Provider for ONNXRT Backend opencv#24024 ### 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
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.