Skip to content

[G-API] Support FP16 input precision for IE backend#20490

Merged
alalek merged 3 commits intoopencv:masterfrom
TolyaTalamanov:at/support-fp16-input-precision
Aug 5, 2021
Merged

[G-API] Support FP16 input precision for IE backend#20490
alalek merged 3 commits intoopencv:masterfrom
TolyaTalamanov:at/support-fp16-input-precision

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 other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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

Build configuration

force_builders=Custom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

build_image:Custom=centos:7
buildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

Xbuild_image:Custom=ubuntu-openvino-2020.3.0:16.04
build_image:Custom Win=openvino-2021.3.0
build_image:Custom Mac=openvino-2021.3.0

test_modules:Custom=gapi,python2,python3,java
test_modules:Custom Win=gapi,python2,python3,java
test_modules:Custom Mac=gapi,python2,python3,java

buildworker:Custom=linux-1
// disabled due high memory usage: test_opencl:Custom=ON
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@mpashchenkov Could you have a look ?

@mpashchenkov
Copy link
Copy Markdown
Contributor

@TolyaTalamanov, Should wrapIE contain HANDLE(16F) variant?

case CV_8U: return IE::Precision::U8;
case CV_32S: return IE::Precision::I32;
case CV_32F: return IE::Precision::FP32;
case CV_16F: return IE::Precision::FP16;
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.

@alalek Could you explain what is the CV_16F actually mean ?
I'm a bit confused, because cv::convertFp16 function returns CV_16S depth.

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.

Discussed locally, thanks!

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.

Please share this info here for the history.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Dedicated cv::convertFp16 call is deprecated and is going to be replaced with common .convertTo() call.

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@TolyaTalamanov, Should wrapIE contain HANDLE(16F) variant?

Done

Copy link
Copy Markdown
Contributor

@mpashchenkov mpashchenkov left a comment

Choose a reason for hiding this comment

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

Looks good for me.

@dmatveev dmatveev self-assigned this Aug 4, 2021
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.

Ok with the change but can this be tested in any form?

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

Ok with the change but can this be tested in any form?

GPU/CPU plugins don't work with FP16.

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@alalek Can we merge it ?

@alalek alalek merged commit 5af09e7 into opencv:master Aug 5, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
TolyaTalamanov added a commit that referenced this pull request Dec 8, 2021
…recision

[G-API] Support FP16 input precision for IE backend

* Support fp16 input precision IE backend

* Add support to wrapIE
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…nput-precision

[G-API] Support FP16 input precision for IE backend

* Support fp16 input precision IE backend

* Add support to wrapIE
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