Commit Graph

352 Commits

Author SHA1 Message Date
Anatoliy Talamanov
eb82ba36a3
Merge pull request #19322 from TolyaTalamanov:at/python-callbacks
[G-API] Introduce cv.gin/cv.descr_of for python

* Implement cv.gin/cv.descr_of

* Fix macos build

* Fix gcomputation tests

* Add test

* Add using to a void exceeded length for windows build

* Add using to a void exceeded length for windows build

* Fix comments to review

* Fix comments to review

* Update from latest master

* Avoid graph compilation to obtain in/out info

* Fix indentation

* Fix comments to review

* Avoid using default in switches

* Post output meta for giebackend
2021-03-01 15:52:11 +00:00
Anatoliy Talamanov
c527b3cefd
Merge pull request #19319 from TolyaTalamanov:at/introduce-gopaque-garray-for-python
[G-API] Introduce GOpaque and GArray for python

* Introduce GOpaque and GArray for python

* Fix ctor

* Avoid code duplication by using macros

* gapi: move Python-specific files to misc/python

* Fix windows build

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-02-09 13:55:16 +00:00
Alexander Alekhin
6b474c4051 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-02-06 00:44:11 +00:00
Pavel Rojtberg
6c1a433c4c python: also catch general c++ exceptions
they might be thrown from third-party code (notably Ogre in the ovis
module).
While Linux is kind enough to print them, they cause instant termination
on Windows.
Arguably, they do not origin from OpenCV itself, but still this helps
understanding what went wrong when calling an OpenCV function.
2021-02-02 21:16:01 +01:00
Alexander Alekhin
2b787eb4b8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-01-31 17:44:15 +00:00
Alexander Alekhin
cdf73f2e05 Merge pull request #19427 from alalek:issue_19426 2021-01-31 14:24:37 +00:00
Alexander Alekhin
c5bf15e009 build: fix cv2.cpp compilation 2021-01-30 11:32:27 +00:00
Alexander Alekhin
e85b41f9be Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-01-25 22:42:13 +00:00
Vadim Levin
1d3207d7c7 feat: common fixed size sequence conversion for Python bindings 2021-01-25 08:08:38 +03:00
Alexander Alekhin
7825abd540 python: handle errors in Rect conversions 2021-01-23 03:07:38 +00:00
Alexander Alekhin
cd59516433 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-01-22 21:29:21 +00:00
Vadim Levin
a0bdb78a99 feat: add overload resolution exception for Python bindings 2021-01-18 16:29:17 +03:00
Alexander Alekhin
dac298ef41 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-18 20:47:56 +00:00
Vadim Levin
7b0d7d0c9a fix: conversion to string in python bindings
If provided `PyObject` can't be converted to string `TypeError` is
 reported instead of `SytemError` without any message.
2020-12-16 15:11:58 +03:00
Alexander Alekhin
464d53bb16 python: emit "string" => "std::string" 2020-11-16 21:34:42 +00:00
Alexander Alekhin
a7c150ec66 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-11-13 22:29:14 +00:00
Alexander Alekhin
5dae278652 bindings: "inline namespace" 2020-11-11 10:38:15 +00:00
Daniel Motilla
bf49149c97 Enable imshow to take GpuMat inputs in Python 2020-10-19 14:35:03 +02:00
Anatoliy Talamanov
e998d89e88 Implement cv.gin and multiple output for python 2020-09-29 13:45:40 +03:00
Maksim Shabunin
89ed813585 python: fixed limited API build 2020-09-25 14:16:46 +03:00
Alexander Alekhin
7163781639
Merge pull request #18343 from TolyaTalamanov:at/support-return-tuple
[G-API] Support std::tuple for return type
2020-09-18 16:38:37 +03:00
Anatoliy Talamanov
a07f064e50
Merge pull request #18332 from TolyaTalamanov:at/wrap-GIn-GOut
[G-API] Wrap GIn & GOut

* Wrap GIn & GOut into python

* Remove extra brackets

* Use reinterpret_cast
2020-09-17 19:00:03 +00:00
Anatoliy Talamanov
5218443784 Support tuple for python bindings 2020-09-16 16:22:46 +03:00
Anatoliy Talamanov
c708f506a4
Merge pull request #17493 from TolyaTalamanov:at/python-bindings-gapi
* Implement G-API python bindings

* Fix hdr_parser

* Drop initlization with brackets using regexp

* Handle bracket initilization another way

* Add test for core operations

* Declaration and definition of View constructor now in different files

* Refactor tests

* Remove combine decorator from tests

* Fix comment to review

* Fix test

* Fix comments to review

* Remove GCompilerArgs implementation from python

Co-authored-by: Pinaev <danil.pinaev@intel.com>
2020-07-29 16:18:52 +03:00
Alexander Alekhin
2cef100303 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-16 18:28:27 +00:00
Vadim Levin
1d8c73cf6c feature: Added explicit support to header parser
- It is safe to remove `explicit` keyword for constructors with 1
argument, because it is C++ specific keyword and does not affect any of
the generated binding.
2020-04-15 14:25:39 +03:00
Alexander Alekhin
d4a17da7b2 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-04 20:49:09 +00:00
Zach Lowry
0aa5391c4b Use argument value for 'mat' in call to format for vector_mat and vector_mat_template
The hard-coded string value "Mat" was used in the two format strings for vector_mat and vector_mat_template, preventing UMat arguments to functions that have these types from working correctly. as noted in #12231.
2020-03-04 08:14:11 +03:00
Alexander Alekhin
aa2777ed61 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-10 19:40:29 +03:00
Pavel Rojtberg
e13a73d084 core: export getCPUFeaturesLine to bindings 2020-02-10 14:06:43 +01:00
Alexander Alekhin
560f85f8e5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-01-28 14:26:57 +03:00
Alexander Alekhin
4cb9faf6c9 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-01-14 17:04:22 +03:00
Vadim Levin
31289d2f32 Merge pull request #15915 from VadimLevin:dev/norm_fix
Fix implicit conversion from array to scalar in python bindings

* Fix wrong conversion behavior for primitive types

  - Introduce ArgTypeInfo namedtuple instead of plain tuple.
    If strict conversion parameter for type is set to true, it is
    handled like object argument in PyArg_ParseTupleAndKeywords and
    converted to concrete type with the appropriate pyopencv_to function
    call.
  - Remove deadcode and unused variables.
  - Fix implicit conversion from numpy array with 1 element to scalar
  - Fix narrowing conversion to size_t type.

* Fix wrong conversion behavior for primitive types

  - Introduce ArgTypeInfo namedtuple instead of plain tuple.
    If strict conversion parameter for type is set to true, it is
    handled like object argument in PyArg_ParseTupleAndKeywords and
    converted to concrete type with the appropriate pyopencv_to function
    call.
  - Remove deadcode and unused variables.
  - Fix implicit conversion from numpy array with 1 element to scalar
  - Fix narrowing conversion to size_t type.·
  - Enable tests with wrong conversion behavior
  - Restrict passing None as value
  - Restrict bool to integer/floating types conversion

* Add PyIntType support for Python 2

* Remove possible narrowing conversion of size_t

* Bindings conversion update

  - Remove unused macro
  - Add better conversion for types to numpy types descriptors
  - Add argument name to fail messages
  - NoneType treated as a valid argument. Better handling will be added
    as a standalone patch

* Add descriptor specialization for size_t

* Add check for signed to unsigned integer conversion safety

  - If signed integer is positive it can be safely converted
    to unsigned
  - Add check for plain python 2 objects
  - Add check for numpy scalars
  - Add simple type_traits implementation for better code style

* Resolve type "overflow" false negative in safe casting check

 - Move type_traits to separate header

* Add copyright message to type_traits.hpp

* Limit conversion scope for integral numpy types

  - Made canBeSafelyCasted specialized only for size_t, so
    type_traits header became unused and was removed.
  - Added clarification about descriptor pointer
2020-01-13 18:11:34 +03:00
cudawarped
d427cebd12 Fix mistake introcuded in previous PR and increase test coverage to avod this happening again 2019-12-16 18:38:58 +00:00
Alexander Alekhin
8108fb0575 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-05 18:27:45 +03:00
cudawarped
b4a3c92867 Merge pull request #15957 from cudawarped:fix_cudacodec_python
Fix cudacodec python

* Add python bindings to cudacodec.

* Allow args with CV_OUT GpuMat& or CV_OUT cuda::GpuMat& to generate python bindings that allow the argument to be an optional output in the same way as OutputArray.

* Add wrapper flag to indicate that an OutputArray is a GpuMat.

* python: drop CV_GPU, extra checks in test

* Remove "cuda::GpuMat" check rom python parser
2019-12-04 18:57:58 +03:00
Alexander Alekhin
4dfa0a0383 bindings: basic support for #if preprocessor directives
- #if 0
- #ifdef __OPENCV_BUILD
2019-12-04 18:42:31 +03:00
Alexander Alekhin
ad0ab4109a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-11-22 22:47:13 +00:00
Alexander Alekhin
5d96f984b1 python: reduce code size of cv2.cpp 2019-11-19 22:43:28 +00:00
Alexander Alekhin
318cba4ce3 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-11-19 19:48:49 +00:00
Alexander Alekhin
2f636b4456 Merge pull request #15918 from alalek:python_debug_parameter 2019-11-19 18:39:56 +00:00
Alexander Alekhin
7ec91aefc1 python: force using of ArgInfo 2019-11-15 19:16:22 +03:00
Alexander Alekhin
973b367da6 python: emit bindings conversion failures on OPENCV_PYTHON_DEBUG=1 2019-11-15 18:55:24 +03:00
Alexander Alekhin
0d7f770996 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-11-04 09:58:29 +00:00
berak
b7c8e9e874 python: fix type error msg 2019-11-02 08:17:07 +01:00
luz.paz
fcc7d8dd4e Fix modules/ typos
Found using `codespell -q 3 -S ./3rdparty -L activ,amin,ang,atleast,childs,dof,endwhile,halfs,hist,iff,nd,od,uint`

backporting of commit: ec43292e1e
2019-08-16 17:34:29 +03:00
luz.paz
ec43292e1e Fix modules/ typos
Found using `codespell -q 3 -S ./3rdparty -L activ,amin,ang,atleast,childs,dof,endwhile,halfs,hist,iff,nd,od,uint`
2019-08-15 18:02:09 -04:00
Lubov Batanina
778f42ad34 Add high level API (Merge pull request #14780)
* Add high level API

* Fix Model

* Add DetectionModel

* Add ClassificationModel

* Fix classify

* Add python test

* Fix pytest

* Fix comments to review

* Fix detect

* Fix docs

* Modify DetectionOutput postprocessing

* Fix test

* Extract ref boxes

* Fix draw rect

* fix test

* Add rect wrap

* Fix wrap

* Fix detect

* Fix Rect wrap

* Fix OCL_FP16

* Fix MyriadX

* Fix nms

* Fix NMS

* Fix coords
2019-07-30 23:07:37 +03:00
Maksim Shabunin
d60ac98ef2 Limited API support for Python3 2019-06-11 15:20:43 +03:00
Maksim Shabunin
10d61a2b44 Limited API support for Python3 2019-06-11 15:15:49 +03:00