Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement poolingLayer using WebNN API and add more detailed logs #390

Open
wants to merge 617 commits into
base: gsoc_2021_webnn
Choose a base branch
from

Conversation

MarkGHX
Copy link
Collaborator

@MarkGHX MarkGHX commented Jul 29, 2021

@huningxin Hi Ningxin, this PR includes the implementation of poolingLayer using WebNN API and some detailed logs. You can use the following codes to check it:

$ ./bin/opencv_test_dnn --gtest_filter=*Test_ONNX_layers.MaxPooling/0*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Test_ONNX_layers
[ RUN      ] Test_ONNX_layers.MaxPooling/0, where GetParam() = WEBNN/CPU
[ WARN:0] global /home/webml/GSoC2021/opencv/modules/dnn/src/layers/pooling_layer.cpp (266) supportBackend ceilMode is not supported by WebNN backend.
[ WARN:0] global /home/webml/GSoC2021/opencv/modules/dnn/src/dnn.cpp (2460) initWebnnBackend Layer Pooling name 1 is unsupported by WebNN backend.
[       OK ] Test_ONNX_layers.MaxPooling/0 (2 ms)
[----------] 1 test from Test_ONNX_layers (2 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (2 ms total)
[  PASSED  ] 1 test.

Thanks a lot!

@MarkGHX MarkGHX requested a review from huningxin July 29, 2021 09:53
@huningxin
Copy link
Owner

@MarkGHX , let's move the discussion to opencv#20406. So OpenCV guys can also watch and comment. Please also add the test results there.

@MarkGHX
Copy link
Collaborator Author

MarkGHX commented Jul 30, 2021

OK, I will repost the test log in opencv#20406.

@MarkGHX MarkGHX force-pushed the gsoc_2021_webnn branch 2 times, most recently from f5083c8 to 89eed5d Compare August 2, 2021 06:21
alalek and others added 24 commits September 28, 2021 20:45
  * sharp Gaussian kernel causes over flow and ends up in blank image
Automatically sets the correct OpenCV version in the CMAKE example contained in the build.gradle
file of the Android SDK.
Use the return value of gst_init_check instead of testing the error pointer
alalek and others added 30 commits November 6, 2021 15:19
Created Stitching Tool based on stitching_detailed.py
Fix: opencv#21021

NDK API AMediaCodec_getOutputBuffer() returns MediaCodecBuffer::data()
which is actually ABuffer::data(). The returned buffer address is already
adjusted by offset.

More info:
    ABuffer::base() returns base address without offset
    ABuffer::data() returns base + offset

Change-Id: I2936339ce4fa9acf657a5a7d92adc1275d7b28a1
fix bug: wrong output dimension when "keep_dims" is false in pooling layer.

* fix bug in max layer

* code align

* delete permute layer and add test case

* add name assert

* check other cases

* remove c++11 features

* style:add "const" remove assert

* style:sanitize file names
3rdparty(protobuf): upgrade 3.5.2 => 3.19.1

* 3rdparty(protobuf): upgrade 3.5.2 => 3.19.1

* dnn: update protobuf files (3.19.1)

* 3rdparty(protobuf): re-apply OpenCV patch for custom fields (3.19.1)

* protobuf: suppress new build warnings

* protobuf: remove unused files
Fluid: SIMD for Resize Linear 8UC3

* SIMD for fluid::Resize 8U3C

* Rework horizontal pass + add 8U4C case

* Reproduce stackoverflow test

* StackOverflow test

* SSE42 impl

* SSE42 impl improvement

* GAPI:SSE42 simd opt for Resize 8UC3. Final version

* Fix tests

* Conditional compilation fix

* Applied comments

* Applied comments. Step2

* Applied comments. Step2
…perf_mod

 G-API: oneVPL - Performance: Add async decode pipeline & add cached pool

* Add async decode pipeline & intro cached pool

* Fix performacne test with checking OPENCV_EXTRA

* Add sip perf test with no VPL

* Fix misprint

* Remove empty line..

* Apply some comments

* Apply some comments

* Make perf test fail if no OPENCV_TEST_DATA_PATH declared
1. Code uses PPC_FEATURE_HAS_VSX, but it's not checked similarly to
PPC_FEATURE2_ARCH_3_00 and PPC_FEATURE2_ARCH_3_00 for availability. FreeBSD has
those macros in machine/cpu.h, but I went with the way chosen for
PPC_FEATURE2_ARCH_3_00 and PPC_FEATURE2_ARCH_3_00. Other than that, FreeBSD also
has sys/auxv.h and that's where elf_aux_info() is defined.
2. getauxval() is actually Linux-only, but code checked for __unix__. It won't
work on all UNIX, so change it back to __linux__. Add another code variant
strictly for FreeBSD.
3. Update comment. This commit adds code for FreeBSD, but recently there
appeared support for powerpc64 in OpenBSD.
…ointset

Fix seg fault houghlinespointset

* Clarify parameter doc for HoughLinesPointSet

* Fix seg fault.

* Add regression test.

* Fix latex typo
…dapter

GAPI: Rename MatAdapter to RMatOnMat
* dnn(ocl4dnn): fix LRN layer accuracy problems

- FP16 intermediate computation is not accurate and may provide NaN values

* dnn(test): update tolerance for FP16
Fix the following build failure with gcc 4.8:

In file included from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg_impl.hpp:100:0,
                 from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg.cpp:50:
/home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg_hw.hpp: In constructor 'HWAccelIterator::HWAccelIterator(cv::VideoAccelerationType, bool, AVDictionary*)':
/home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg_hw.hpp:939:23: error: use of deleted function 'std::basic_istringstream<char>& std::basic_istringstream<char>::operator=(const std::basic_istringstream<char>&)'
             s_stream_ = std::istringstream(accel_list);
                       ^
In file included from /home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/arm-none-linux-gnueabi/include/c++/4.8.3/complex:45:0,
                 from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/core/include/opencv2/core/cvstd.inl.hpp:47,
                 from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/core/include/opencv2/core.hpp:3306,
                 from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/include/opencv2/videoio.hpp:46,
                 from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/precomp.hpp:57,
                 from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg.cpp:42:
/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/arm-none-linux-gnueabi/include/c++/4.8.3/sstream:272:11: note: 'std::basic_istringstream<char>& std::basic_istringstream<char>::operator=(const std::basic_istringstream<char>&)' is implicitly deleted because the default definition would be ill-formed:
     class basic_istringstream : public basic_istream<_CharT, _Traits>
           ^
/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/arm-none-linux-gnueabi/include/c++/4.8.3/sstream:272:11: error: use of deleted function 'std::basic_istream<char>& std::basic_istream<char>::operator=(const std::basic_istream<char>&)'

Fixes:
 - http://autobuild.buildroot.org/results/60f8846b435dafda0ced412d59ffe15bdff0810d

Signed-off-by: Fabrice Fontaine <[email protected]>
…ples

Move API sample code to tutorial_code location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.