Commit Graph

15510 Commits

Author SHA1 Message Date
Alexander Alekhin
bab4bc0968 Merge pull request #9284 from ipuustin:dnn-opencl-fixes 2017-08-01 13:06:01 +00:00
Alexander Alekhin
f6c4901b8f Merge pull request #9279 from alalek:ocl_fix_program_cache 2017-08-01 13:05:43 +00:00
Jiri Horner
bb6496d9e5 Merge pull request #8951 from hrnr:akaze_part2
[GSOC] Speeding-up AKAZE, part #2 (#8951)

* feature2d: instrument more functions used in AKAZE

* rework Compute_Determinant_Hessian_Response

* this takes 84% of time of Feature_Detection
* run everything in parallel
* compute Scharr kernels just once
* compute sigma more efficiently
* allocate all matrices in evolution without zeroing

* features2d: add one bigger image to tests

* now test have images: 600x768, 900x600 and 1385x700 to cover different resolutions

* explicitly zero Lx and Ly

* add Lflow and Lstep to evolution as in original AKAZE code

* reworked computing keypoints orientation

integrated faster function from https://github.com/h2suzuki/fast_akaze

* use standard fastAtan2 instead of getAngle

* compute keypoints orientation in parallel

* fix visual studio warnings

* replace some wrapped functions with direct calls to OpenCV functions

* improved readability for people familiar with opencv
* do not same image twice in base level

* rework diffusity stencil

* use one pass stencil for diffusity from https://github.com/h2suzuki/fast_akaze
* improve locality in Create_Scale_Space

* always compute determinat od hessian and spacial derivatives

* this needs to be computed always as we need derivatives while computing descriptors
* fixed tests of AKAZE with KAZE descriptors which have been affected by this

Currently it computes all first and second order derivatives together and the determiant of the hessian. For descriptors it would be enough to compute just first order derivates, but it is not probably worth it optimize for scenario where descriptors and keypoints are computed separately, since it is already very inefficient. When computing keypoint and descriptors together it is faster to do it the current way (preserves locality).

* parallelize non linear diffusion computation

* do multiplication right in the nlp diffusity kernel

* rework kfactor computation

* get rid of sharing buffers when creating scale space pyramid, the performace impact is neglegible

* features2d: initialize TBB scheduler in perf tests

* ensures more stable output
* more reasonable profiles, since the first call of parallel_for_ is not getting big performace hit

* compute_kfactor: interleave finding of maximum and computing distance

* no need to go twice through the data

* start to use UMats in AKAZE to leverage OpenCl in the future

* fixed bug that prevented computing determinant for scale pyramid of size 1 (just the base image)
* all descriptors now support writing to uninitialized memory
* use InputArray and OutputArray for input image and descriptors, allows to make use UMAt that user passes to us

* enable use of all existing ocl paths in AKAZE

* all parts that uses ocl-enabled functions should use ocl by now

* imgproc: fix dispatching of IPP version when OCL is disabled

* when OCL is disabled IPP version should be always prefered (even when the dst is UMat)

* get rid of copy in DeterminantHessian response

* this slows CPU version considerably
* do no run in parallel when running with OCL

* store derivations as UMat in pyramid

* enables OCL path computing of determint hessian
* will allow to compute descriptors on GPU in the future

* port diffusivity to OCL

* diffusivity itself is not a blocker, but this saves us downloading and uploading derivations

* implement kernel for nonlinear scalar diffusion step

* download the pyramid from GPU just once

we don't want to downlaod matrices ad hoc from gpu when the function in AKAZE needs it. There is a HUGE mapping overhead and without shared memory support a LOT of unnecessary transfers.

This maps/downloads matrices just once.

* fix bug with uninitialized values in non linear diffusion

* this was causing spurious segfaults in stitching tests due to propagation of NaNs
* added new test, which checks for NaNs (added new debug asserts for NaNs)
* valgrind now says everything is ok

* add nonlinear diffusion step OCL implementation

* Lt in pyramid changed to UMat, it will be downlaoded from GPU along with Lx, Ly
* fix bug in pm_g2 kernel. OpenCV mangles dimensions passed to OpenCL, so we need to check for boundaries in each OCL kernel.

* port computing of determinant to OCL

* computing of determinant is not a blocker, but with this change we don't need to download all spatial derivatives to CPU, we only download determinant
* make Ldet in the pyramid UMat, download it from CPU together with the other parts of the pyramid
* add profiling macros

* fix visual studio warning

* instrument non_linear_diffusion

* remove changes I have made to TEvolution

* TEvolution is used only in KAZE now

* Revert "features2d: initialize TBB scheduler in perf tests"

This reverts commit ba81e2a711.
2017-08-01 12:46:01 +00:00
Ismo Puustinen
c2de5cf735 dnn: force floating point literals to be float.
In OpenCL code in activations.cl, make the type of floating point
literals to be float. Otherwise the values will be interpreted as
doubles, causing Beignet to have type conversion issues.
2017-08-01 15:02:24 +03:00
Alexander Alekhin
2959e7aba9 Merge pull request #9188 from arrybn:mobilenet_ssd_sample 2017-08-01 11:12:54 +00:00
Aleksandr Rybnikov
ce1cc352d9 MobileNet SSD sample 2017-08-01 12:30:27 +03:00
Alexander Alekhin
d34eec3ab3 Merge pull request #9278 from alalek:ts_perf_threads 2017-07-31 16:21:51 +00:00
Alexander Alekhin
16fb74425e ocl: fix program cache key 2017-07-31 17:24:08 +03:00
Alexander Alekhin
3786d30320 Merge pull request #9225 from paroj:reproject_cpp 2017-07-31 14:11:37 +00:00
Alexander Alekhin
50b9a5afa9 ts(perf): initialize ThreadPool 2017-07-31 16:51:08 +03:00
Alexander Alekhin
06a9c16961 Merge pull request #9275 from alalek:cmake_protobuf_optional 2017-07-31 12:03:54 +00:00
Alexander Alekhin
d22506092e Merge pull request #9274 from alalek:ipp_meanstddev 2017-07-31 12:02:59 +00:00
Alexander Alekhin
728bd68977 Merge pull request #9272 from tomoaki0705:fixCudaBuild 2017-07-31 12:02:40 +00:00
Alexander Alekhin
cbced23de4 cmake: don't include protobuf on disabled DNN module 2017-07-31 14:18:59 +03:00
Alexander Alekhin
e58a778bd5 core(stat): disable IPP optimization in meanStdDev (cn > 1) 2017-07-31 14:09:18 +03:00
Tomoaki Teshima
1c49796e8e guad for CUDA correctly 2017-07-31 18:42:36 +09:00
Alexander Alekhin
46f05f2db6 python: disable assertion in NumpyAllocator 2017-07-30 14:44:11 +03:00
Alexander Alekhin
15a6586062 python: stitching simple test 2017-07-30 14:44:10 +03:00
Alexander Alekhin
fffd0f5b68 Merge pull request #9241 from alalek:tlsSlotsSize 2017-07-30 09:53:39 +00:00
Alexander Alekhin
34f9c039c5 Merge pull request #9238 from alalek:valgrind_fixes 2017-07-27 14:33:01 +00:00
Alexander Alekhin
d35422b523 core(tls): hide assertions from Thread Sanitizer 2017-07-27 17:31:51 +03:00
Alexander Alekhin
68ef903a7c core(tls): don't use tlsSlots without synchronization 2017-07-26 22:45:55 +03:00
Alexander Alekhin
06407b4d14 Merge pull request #9233 from LaurentBerger:dnndoc 2017-07-26 16:25:28 +00:00
Alexander Alekhin
12213f9985 flann: fix out of buffer access 2017-07-26 18:17:03 +03:00
Alexander Alekhin
caa5e3b4c5 imgproc: fix vectorized code of accumulate 2017-07-26 17:21:46 +03:00
Alexander Alekhin
2e17251160 calib3d: fix invalid memory access 2017-07-26 17:21:46 +03:00
Alexander Alekhin
3f102e5d3a dnn: protobuf shutdown 2017-07-26 17:21:46 +03:00
Alexander Alekhin
aad6d28e13 ts: don't run large videoio test (valgrind) 2017-07-26 17:21:46 +03:00
Alexander Alekhin
1650c664bc ts: don't run imgcodecs tests on large images (valgrind) 2017-07-26 17:21:46 +03:00
Alexander Alekhin
d17b099994 ts: don't run DNN tests with large models (valgrind) 2017-07-26 17:21:46 +03:00
Alexander Alekhin
bf0173bf38 ts: update valgrind suppressions 2017-07-26 17:21:45 +03:00
Alexander Alekhin
b4e300b78b Merge pull request #9236 from dkurt:fix_json_bool 2017-07-26 13:08:13 +00:00
Alexander Alekhin
402a77e7f7 Merge pull request #9237 from alalek:fix_winrt_build 2017-07-26 10:42:49 +00:00
Alexander Alekhin
2ca561f104 Merge pull request #9217 from alalek:cleanup_3rdparty 2017-07-26 10:38:28 +00:00
dkurt
583b327523 Fix JSON booleans without quotes 2017-07-26 12:51:06 +03:00
LaurentBerger
69fd57bc96 update tutorial link for dnn 2017-07-25 19:32:17 +02:00
Alexander Alekhin
c512bf6c66 Merge pull request #9232 from dkurt:json_named_nodes 2017-07-25 15:56:03 +00:00
Alexander Alekhin
bcff9fd067 Merge pull request #9229 from alalek:dnn_torch_memory_leaks 2017-07-25 13:23:18 +00:00
dkurt
3515f6ec33 Missed NAMED bit of JSON nodes tag 2017-07-25 13:39:32 +03:00
Alexander Alekhin
602f047fe8 build: replace WIN32 => _WIN32 2017-07-25 13:30:48 +03:00
Alexander Alekhin
7f3eea6325 core: fix Mat/UMat cleanup on exceptions in deallocate() 2017-07-25 12:27:30 +03:00
Alexander Alekhin
878a6906cc dnn: fix torch importer memory leaks 2017-07-25 12:20:55 +03:00
Pavel Rojtberg
94fdd45b75 calib3d: rewrite reprojectImageTo3D using Matx expressions
about the same speed, but significatly more readable
2017-07-24 17:36:31 +02:00
dkurt
70ff3804e9 Fix SqueezeNet Halide performance test 2017-07-24 10:45:04 +03:00
Alexander Alekhin
432d0fd707 Merge pull request #9213 from tomoaki0705:fixDnnBaseline 2017-07-21 13:34:47 +00:00
Alexander Alekhin
e45d5446f2 cleanup unused 3rdparty files 2017-07-21 15:20:13 +03:00
Tomoaki Teshima
0f91faddae fix linker error when trying CPU_BASELINE=AVX 2017-07-21 21:13:47 +09:00
Alexander Alekhin
bc3c7e80a6 Merge pull request #9209 from alalek:fix_persistence_format 2017-07-21 10:55:40 +00:00
Alexander Alekhin
544eb4be1f IPP: update minMaxIdx, disable some AVX optimizations with mask 2017-07-21 12:56:36 +03:00
Alexander Alekhin
d9e092325b test: regression test for IPP minMaxIdx problem 2017-07-21 12:55:07 +03:00