Skip to content

G-API: oneVPL (simplification) Add data adapter & Cfg params#20570

Merged
alalek merged 15 commits intoopencv:masterfrom
sivanov-work:vpl_source_data_adapter
Aug 24, 2021
Merged

G-API: oneVPL (simplification) Add data adapter & Cfg params#20570
alalek merged 15 commits intoopencv:masterfrom
sivanov-work:vpl_source_data_adapter

Conversation

@sivanov-work
Copy link
Copy Markdown
Contributor

@sivanov-work sivanov-work commented Aug 18, 2021

this PR is the single one in series of #20469

Introduce DataProvider adapter: to read data as either FILE or stream or custom
Introduce CFG params

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

Xbuild_image:Custom=centos:7
Xbuildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

build_image:Custom=ubuntu-openvino-2021.3.0:20.04
build_image:Custom Win=openvino-2021.2.0
build_image:Custom Mac=openvino-2021.2.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
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

@dmatveev dmatveev self-assigned this Aug 18, 2021
@dmatveev dmatveev added this to the 4.5.4 milestone Aug 18, 2021
@dmatveev
Copy link
Copy Markdown
Contributor

dmatveev commented Aug 18, 2021

Simple question - is a machine in OpenCV buildbot with vpl available so that this code can actually be built? cc: @alalek

Harder question - I doubt if file source and configs are the right thing for this step - the source itself doesn't work isn't it?

@sivanov-work
Copy link
Copy Markdown
Contributor Author

sivanov-work commented Aug 20, 2021

@dmatveev

Simple question - is a machine in OpenCV buildbot with vpl available so that this code can actually be built? cc: @alalek

Harder question - I doubt if file source and configs are the right thing for this step - the source itself doesn't work isn't it?

I found a comment from @alalek about possibility for introducing oneAPI in next 2-3 weeks
#20546 (review)

Looks like it' might be answer and looks like my further PRs code would be inactivated until this time

@alalek could you confirm or reject please?

void*,
std::string>;
template<typename ValueType>
static oneVPL_cfg_param create(const std::string& name, ValueType&& value, bool is_major = true) {
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.

what does is_major mean? Also, I'd suggest writing doxygen comments at some early point since we always forget to add em later

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.

will be added

Comment on lines +18 to +29
struct GAPI_EXPORTS DataProviderException : public std::exception {
virtual ~DataProviderException() {};
};

struct GAPI_EXPORTS DataProviderSystemErrorException : public DataProviderException {
DataProviderSystemErrorException(int error_code, const std::string& desription = std::string());
virtual ~DataProviderSystemErrorException();
virtual const char* what() const noexcept override;

private:
std::string reason;
};
Copy link
Copy Markdown
Contributor

@dmatveev dmatveev Aug 20, 2021

Choose a reason for hiding this comment

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

y u need a special exception type here? usually we throw a logic_error and its string argument is enough to provide reason like here.

Copy link
Copy Markdown
Contributor Author

@sivanov-work sivanov-work Aug 23, 2021

Choose a reason for hiding this comment

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

in recognition reason: i believe user can recognize that and make a proper decision on explicit error.

BTW it depict explicit intention during DataProvider implementation .When i saw an abstract interface i would ask myself: how i should process an unrecoverable error here: logic_error or runtime_error or bad_alloc of filesystem error? Answer is DataProviderSystemErrorException

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.

We don't have a project-wide exception / error-handling policy here (except the one I mentioned above), so I'm just wondering whether it is the right time to introduce / derive a new one or keep the old approach (before the one is introduced)

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.

LGTM

@sivanov-work
Copy link
Copy Markdown
Contributor Author

@alalek Could you please merge it?
Custom Win is failed on PR build table (https://pullrequest.opencv.org/buildbot/builders/precommit_custom_windows/builds/2550) but i'm sure this is not my fault: some dnn python tests were failed in that build and i didn't touch anything in python or dnn

@alalek alalek merged commit 65ef82a into opencv:master Aug 24, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…pter

G-API: oneVPL (simplification) Add data adapter & Cfg params

* Add cfg_param & data_provider

* Fix compilation after rebase

* Apply some comments

* Apply default ctor outside class definition comment

* Apply cfg param in source

* Fix compilation: add virtual dtor

* Move cfg_params in regular gapi src list

* Fix compilation: add export.hpp

* Add errno.h

* Add errno.h

* Apply namespace comment

* Add several Doxygen & rename cfg_param

* Fix build

* Update Doxygen docs for onevpl

* Fix typo
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