Vadim Levin
16b9514543
feat: update conversion logic for `std::vector<T>` in Python bindings
...
`PyObject*` to `std::vector<T>` conversion logic:
- If user passed Numpy Array
- If array is planar and T is a primitive type (doesn't require
constructor call) that matches with the element type of array, then
copy element one by one with the respect of the step between array
elements. If compiler is lucky (or brave enough) copy loop can be
vectorized.
For classes that require constructor calls this path is not
possible, because we can't begin an object lifetime without hacks.
- Otherwise fall-back to general case
- Otherwise - execute the general case:
If PyObject* corresponds to Sequence protocol - iterate over the
sequence elements and invoke the appropriate `pyopencv_to` function.
`std::vector<T>` to `PyObject*` conversion logic:
- If `std::vector<T>` is empty - return empty tuple.
- If `T` has a corresponding `Mat` `DataType` than return
Numpy array instance of the matching `dtype` e.g.
`std::vector<cv::Rect>` is returned as `np.ndarray` of shape `Nx4` and
`dtype=int`.
This branch helps to optimize further evaluations in user code.
- Otherwise - execute the general case:
Construct a tuple of length N = `std::vector::size` and insert
elements one by one.
Unnecessary functions were removed and code was rearranged to allow
compiler select the appropriate conversion function specialization.
3 years ago
Alexander Alekhin
95c7f4a7f0
Merge pull request #20635 from alalek:issue_20559
3 years ago
Alexander Alekhin
ae6fabc6fe
dnn(ocl): drop CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE check
...
- it is a hint and it should not block kernel execution
3 years ago
Alexander Alekhin
7eaadf616c
Merge pull request #20622 from diablodale:fix20544-nodiscard
3 years ago
Alexander Alekhin
8fed5fc5ae
Merge pull request #20633 from alalek:ocl_dumpValue_handle_null
3 years ago
Alexander Alekhin
f25951c412
core(ocl): handle NULL in dumpValue() debug call
...
- NULL is used for allocation of workgroup local variables
3 years ago
Alexander Alekhin
1259a474ba
Merge pull request #20625 from alalek:fix_msvc_warnings
3 years ago
Dale Phurrough
3995deaf76
fix opencv/opencv#20544 nodiscard for msvc/gcc
...
- includes workaround for preprocessor non-compliance
- enable attribute syntax checking in msvc
3 years ago
Alexander Alekhin
076587425e
build: eliminate build warnings
3 years ago
Alexander Alekhin
da6aeaca46
Merge pull request #20623 from alalek:fix_java_byte
3 years ago
Alexander Alekhin
8ee33ca551
java(test): avoid deprecation warning
...
- 'new Byte' => 'Byte.valueOf'
3 years ago
Alexander Alekhin
ea7f13922b
Merge pull request #20609 from vrabaud:3.4
3 years ago
Vincent Rabaud
38d0063c36
Do not use deprecated ReleaseCleared in protobuf library.
...
This is to make code work with protobuf arenas for memory
management (ReleaseCleared is incompatible).
The cleaning of the memory is also simpler.
3 years ago
Alexander Alekhin
df83459721
Merge pull request #20602 from diablodale:fix20594-refcounts-wiith-exceptions
3 years ago
Dale Phurrough
54a9e00970
fix opencv/opencv#20594 - exception handling with refcounts
3 years ago
Dale Phurrough
9bda96d39e
add test case
3 years ago
Alexander Alekhin
77a5c43d50
Merge pull request #20586 from alalek:issue_20585
3 years ago
Alexander Alekhin
f28e4b86fb
dnn(ocl): fix top initialization in verifyResult
3 years ago
Alexander Alekhin
b675e6ab77
Merge pull request #20581 from alalek:issue_20571
3 years ago
Alexander Panov
d6306f8ccb
Merge pull request #20564 from AleksandrPanov:update_kalman_sample
...
Update kalman sample
* updated view and comments, fixed dims
* updated view and comments, added statePost
3 years ago
Alexander Alekhin
a9817e9127
Merge pull request #20556 from rogday:onnx_split_sum_fix
3 years ago
Alexander Alekhin
c08897cd10
cmake: handle empty CVPY_SUFFIX
3 years ago
Alexander Alekhin
384875f4fc
Merge pull request #20386 from vrabaud:3.4
3 years ago
Vincent Rabaud
9cfa84313c
Use the one argument version of SetTotalBytesLimit.
...
The two argument versions has been deprecated, cf
https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.coded_stream
3 years ago
Smirnov Egor
fe625a558e
fix hasDynamicShapes for batch_size and fix axis selection in Scale layer
3 years ago
Smirnov Egor
9ef41f68fb
fix Split partial sum
3 years ago
Julia Bareeva
cfb36443fb
Merge pull request #20506 from JulieBar:lstm_activations
...
* Support activations(Sigmoid, Tanh) for LSTM
* fix warning
3 years ago
Alexander Alekhin
9d3826c676
Merge pull request #20525 from SamFC10:fix-prior-variances
3 years ago
Iyad Ahmed
4300bb2e1f
Merge pull request #20541 from iyadahmed:video_capture_timeout_prop
...
* VideoCapture timeout set/get
* Common formatting for enum values
* Fix enum values wrongly in videoio.hpp
* Define timeout enum values in public api and align with master
3 years ago
Alexander Alekhin
6edc438789
Merge pull request #20545 from AleksandrPanov:resize_docummentation
3 years ago
AleksandrPanov
25cd7c7c50
add note about Python's dsize to doc
3 years ago
Alexander Alekhin
732cb6c45c
Merge pull request #20515 from utibenkei:fix_java_ml_testSaveLoad
3 years ago
Alexander Alekhin
266a868ba9
Merge pull request #20533 from AleksandrPanov:minAreaRect_fix_rotatingCalipers
3 years ago
AleksandrPanov
8199967b31
fix choose minimum angle in rotatingCalipers
3 years ago
utibenkei
9d61c18143
fix testSaveLoad
3 years ago
Alexander Alekhin
221bfa4c67
Merge pull request #20466 from rogday:efficientnet_fix_34
3 years ago
Alexander Alekhin
1a8b7f7513
Merge pull request #20500 from AleksandrPanov:findContours_documentation
3 years ago
AleksandrPanov
992b47b991
add 19769 and 19769_lightweight tests
3 years ago
Smirnov Egor
739ff84732
add Max layer to TFImporter
3 years ago
SamFC10
2a177052de
fix bug in prior-box variances
3 years ago
Alexander Alekhin
f7c82baee9
Merge pull request #20505 from AleksandrPanov:contours_tutorial_documentation
3 years ago
Alexander Alekhin
2b34e0abdc
Merge pull request #20502 from ddacw:3.4
3 years ago
Julia Bareeva
633fedaa96
Merge pull request #20480 from JulieBar:lstm_pytest
...
Add Python's test for LSTM layer
* Add Python's test for LSTM layer
* Set different test threshold for FP16 target
* rename test to test_input_3d
Co-authored-by: Julie Bareeva <julia.bareeva@xperience.ai>
3 years ago
AleksandrPanov
65134c793b
add links in python and js contours tutorial
3 years ago
Abhinav Sharma
d5f34cf34c
Merge pull request #20493 from abhi-bhatra:patch-1
...
Fix Broken Link
* Update README.md
Fix broken link
* Update Readme.txt
* Update readme.txt
Add missing link
* Update readme.txt
Fix names
3 years ago
Duong Dac
cefa602601
Avoid adding false UMat/GpuMat declaration
3 years ago
AleksandrPanov
d773691848
add note about hierarchy in python version
3 years ago
Alexander Alekhin
f40707dc68
Merge pull request #20487 from AleksandrPanov:traincascade_documentation
3 years ago
AleksandrPanov
2d8ce500fa
add note about using version 3.4 to traincascade documentation
3 years ago
Alexander Alekhin
ddf1b04cce
Merge pull request #20485 from VadimLevin:dev/vlevin/fix-reserved-python-keyword-arguments
3 years ago