Skip to content

Solves #19754#19771

Merged
alalek merged 2 commits intoopencv:masterfrom
lionkunonly:opencvjsNodeFix
Apr 1, 2021
Merged

Solves #19754#19771
alalek merged 2 commits intoopencv:masterfrom
lionkunonly:opencvjsNodeFix

Conversation

@lionkunonly
Copy link
Copy Markdown
Contributor

@lionkunonly lionkunonly commented Mar 24, 2021

resolves #19754

This is a Pull Request for the Issue 19754

For the perf tests in OpenCV.js, the scripts can not run successfully on Node.js. In this PR, I modify the scripts in perf tests so that the functions imported from other modules can run successfully in perf tests.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
force_builders=Custom
buildworker:Docs=linux-4,linux-6
build_image:Docs=docs-js:18.04
build_image:Custom=javascript
buildworker:Custom=linux-4,linux-6

@alalek
Copy link
Copy Markdown
Member

alalek commented Mar 24, 2021

@lionkunonly Thank you!

@jlb6740 Could you please check this patch in your environment?

@jlb6740
Copy link
Copy Markdown

jlb6740 commented Mar 27, 2021

Hi @alalek @lionkunonly, sorry only noticed this update here. Yes! I tried the patch and indeed it appears to resolve the issue. The steps I followed were:

#using emscripten 2.0.15
emcmake python3 platforms/js/build_js.py build_wasm --build_wasm --simd --build_wasm_intrin_test --build_perf

cd build_wasm/bin/perf

#using node 14.15.5 (probably not all these flags are needed)
node --experimental-wasi-unstable-preview1 --experimental-wasm-simd --experimental-wasm-threads --experimental-wasm-type-reflection --experimental-wasm-mv --wasm-atomics-on-non-shared-memory perf_imgproc/perf_threshold.js

I also tested cvtColor.js which worked fine.

@alalek
Copy link
Copy Markdown
Member

alalek commented Mar 27, 2021

@jlb6740 Thank you for checking this!

@lionkunonly
This patch should go into 3.4 branch first.
We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@alalek
Copy link
Copy Markdown
Member

alalek commented Mar 31, 2021

@lionkunonly I'm not able to update PR source branch because your fork is not forked from opencv/opencv repository:

lionkunonly / opencv
forked from huningxin/opencv

You can grab rebased commit from here: https://github.com/alalek/opencv/commits/pr19771_r

@alalek alalek merged commit 32d5131 into opencv:master Apr 1, 2021
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: javascript (js) feature port/backport done Label for maintainers. Authors of PR can ignore this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm perf tests RuntimeError: abort(TypeError: cv.Size is not a constructor).

3 participants