Conversation
* Wrap timestamp, seqNo, seq_id * Wrap copy * Wrap parseSSD, parseYolo
|
@mpashchenkov Have a look, please |
modules/python/src2/cv2.cpp
Outdated
| { | ||
| if (!obj || obj == Py_None) | ||
| { | ||
| return true; |
There was a problem hiding this comment.
Why does the if return true here?
There was a problem hiding this comment.
There was a problem hiding this comment.
this is used for handling "default values" of arguments
…end-python-bindings
|
@alalek @mpashchenkov Could you have a look, please ? |
alalek
left a comment
There was a problem hiding this comment.
what is about adding of test code for new functionality?
modules/python/src2/cv2.cpp
Outdated
| } | ||
|
|
||
| template<> | ||
| bool pyopencv_to(PyObject* obj, int64& value, const ArgInfo& info) |
There was a problem hiding this comment.
Bindings generator doesn't support int64 type in functions signatures. No plans to add that due to ambiguous using and compatibility issues with other languages. Consider using int / size_t instead.
It makes sense to add note here.
There was a problem hiding this comment.
Can I implement pyopencv_to(int64_t) with static_cast to size_t ?
There was a problem hiding this comment.
Main problem with size_t is that it is unsigned.
There was a problem hiding this comment.
Removed this implementation. Looks like it isn't necessary to read int64 data from python so far.
modules/python/src2/cv2.cpp
Outdated
| { | ||
| if (!obj || obj == Py_None) | ||
| { | ||
| return true; |
There was a problem hiding this comment.
this is used for handling "default values" of arguments
75993c7 to
a998612
Compare
| HANDLE_CASE(RECT, cv::Rect); | ||
| HANDLE_CASE(UNKNOWN, cv::GArg); | ||
| UNSUPPORTED(UINT64); | ||
| UNSUPPORTED(INT64); |
There was a problem hiding this comment.
Unsupported for pyopencv_to
| return EPtr{new GraphMetaExecutable(graph, nodes)}; | ||
| } | ||
|
|
||
| virtual bool controlsMerge() const override |
There was a problem hiding this comment.
what is about adding of test code for new functionality?
Added test: seq_id, seqNo, timestamp.
Already testing: parseSSD, networks
Didn't add test for parseYolo since there is no suitable model on CI
|
@alalek Could you have a look, please ? |
0f5fae4 to
dcfddce
Compare
| { | ||
| PyErr_SetString(PyExc_TypeError, "Unsupported type for cv.GIn()/cv.GOut()"); | ||
| return NULL; | ||
| util::throw_error(std::logic_error("Unsupported type for GProtoArgs")); |
There was a problem hiding this comment.
Does the message appear in error log? Why is not PyErr_SetString?
There was a problem hiding this comment.
Because caller function handles this exception and setup PyErr_SetString.
https://github.com/TolyaTalamanov/opencv/blob/at/extend-python-bindings/modules/gapi/misc/python/pyopencv_gapi.hpp#L929
| has_frame, (ts, seqno, seqid) = ccomp.pull() | ||
|
|
||
| if not has_frame: | ||
| break |
There was a problem hiding this comment.
Should the if contain an error message?
There was a problem hiding this comment.
I don't think so, in fact I just put it in case video less than 10 frames
|
@alalek Can it be merged ? |
…bindings G-API: Extend python bindings * Extend G-API bindings * Wrap timestamp, seqNo, seq_id * Wrap copy * Wrap parseSSD, parseYolo * Rewrap cv.gapi.networks * Add test for metabackend in pytnon * Remove int64 pyopencv_to
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.
Build configuration