G-API Expose all core operations to python#22494
Conversation
| */ | ||
| GAPI_EXPORTS GMat blur(const GMat& src, const Size& ksize, const Point& anchor = Point(-1,-1), | ||
| int borderType = BORDER_DEFAULT, const Scalar& borderValue = Scalar(0)); | ||
| GAPI_EXPORTS_W GMat blur(const GMat& src, const Size& ksize, const Point& anchor = Point(-1,-1), |
There was a problem hiding this comment.
Exception from core operations, just want it to be exposed asap :)
| @note Function textual ID is "org.opencv.core.kmeans3D" | ||
| */ | ||
| GAPI_EXPORTS std::tuple<GOpaque<double>,GArray<int>,GArray<Point3f>> | ||
| GAPI_EXPORTS_W std::tuple<GOpaque<double>,GArray<int>,GArray<Point3f>> |
There was a problem hiding this comment.
Make sense to add test for this one because it touches a lot of existing functionality.
There was a problem hiding this comment.
Yes, add test for kmeans because it returns Point3f which wasn't supported before
|
@dmatveev Could you have a look, please? |
dmatveev
left a comment
There was a problem hiding this comment.
We need to do something with all that our type enumerations in all these different headers... Worth a TODO
| @note Function textual ID is "org.opencv.core.kmeans3D" | ||
| */ | ||
| GAPI_EXPORTS std::tuple<GOpaque<double>,GArray<int>,GArray<Point3f>> | ||
| GAPI_EXPORTS_W std::tuple<GOpaque<double>,GArray<int>,GArray<Point3f>> |
| CV_STRING, // std::string user G-API data | ||
| CV_POINT, // cv::Point user G-API data | ||
| CV_POINT2F, // cv::Point2f user G-API data | ||
| CV_POINT3F, // cv::Point3f user G-API data |
There was a problem hiding this comment.
Missed the below type? See GOpaqueTraits
There was a problem hiding this comment.
I didn't exposed it for purpose, because there weren't such cases
There was a problem hiding this comment.
But it is an inconsistency now, isnt it?
And now its only you who knows the reason for it (ok, and me)
|
@TolyaTalamanov Friendly reminder. |
e567339 to
2b601de
Compare
2b601de to
f8eca04
Compare
| CV_STRING, // std::string user G-API data | ||
| CV_POINT, // cv::Point user G-API data | ||
| CV_POINT2F, // cv::Point2f user G-API data | ||
| CV_POINT3F, // cv::Point3f user G-API data |
| self.assertEqual(K, len(centers)) | ||
|
|
||
|
|
||
| def test_kmeans_3d(self): |
There was a problem hiding this comment.
Actually tests only functionality without accuracy checking with ocv
|
@dmatveev Could you have a look, please? |
|
@asmorkalov Can it be merged? |
|
@alalek @asmorkalov Could you merge it, please? |
…e-to-python G-API Expose all core operations to python * Expose all G-API core operations to python * Fix typo in python gapi types test
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.
Motivation
Python bindings are available since a long time, but only a few operations (
operation::on(...)wrappers) were exposed.There was a great plan to implement feature in python parser that could automatically detect
G-APIoperation (viaGAPI_TYPED_KERNELmacro or so) and expose it into python, but this functionality is more about giving an opportunity to user to implement pythonkernelsfor already existing in G-API operations.This PR is going to expose just
operation::onwrappers to python in order to give user everything that is available from c++, because now, for developers who don't build from source and change the code only available a small amount of functionality.Since a lot of developers use
opencvfrompiplet's expose it once and forever.Great example of G-API usage: https://github.com/xiong-jie-y/g_api_examples
TODO list:
coreimgprocvideostereoG-Type's & some compiler args)