Skip to content

G-API: Fix async inference for OpenVINO backend#23884

Merged
asmorkalov merged 2 commits intoopencv:4.xfrom
TolyaTalamanov:at/fix-async-infer-ov-backend
Jun 28, 2023
Merged

G-API: Fix async inference for OpenVINO backend#23884
asmorkalov merged 2 commits intoopencv:4.xfrom
TolyaTalamanov:at/fix-async-infer-ov-backend

Conversation

@TolyaTalamanov
Copy link
Copy Markdown
Contributor

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

if (this_nh == nullptr) {
this_nh = nh;
compiled = const_cast<OVUnit&>(ovm.metadata(this_nh).get<OVUnit>()).compile();
m_reqPool.reset(new RequestPool(createInferRequests(compiled.compiled_model, 1)));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

😱

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@asmorkalov Could you have a look, please? 😥

@asmorkalov asmorkalov requested a review from dmatveev June 28, 2023 09:46
@asmorkalov
Copy link
Copy Markdown
Contributor

@dmatveev Please take a look.

.compile_model(model, params.device, toOV(params.config));
}
return {compiled_model};
return {compiled_model, params.nireq};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nireq is not modified in compile or somewhere else and used as pipeline input. Why do you need it here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well, it should be available from graph metadata in order to extract this value to create RequestPool.
OVCompiled is the only structure which is accessible from meta.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, got your point, let's just get it from OVUnit, thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@dmatveev dmatveev self-assigned this Jun 28, 2023
Copy link
Copy Markdown
Contributor

@dmatveev dmatveev left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

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

👍 Tested manually with OpenVINO 2022.1.1.7030.

@asmorkalov asmorkalov merged commit b8b8c7c into opencv:4.x Jun 28, 2023
@asmorkalov asmorkalov mentioned this pull request Jul 27, 2023
thewoz pushed a commit to thewoz/opencv that referenced this pull request Jan 4, 2024
…r-ov-backend

G-API: Fix async inference for OpenVINO backend opencv#23884

### 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
thewoz pushed a commit to thewoz/opencv that referenced this pull request May 29, 2024
…r-ov-backend

G-API: Fix async inference for OpenVINO backend opencv#23884

### 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
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.

3 participants