Skip to content

opencv.js: fix the loading issue of opencv.js(WASM) in face recognition#14737

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
Wenzhao-Xiang:master
Jun 20, 2019
Merged

opencv.js: fix the loading issue of opencv.js(WASM) in face recognition#14737
opencv-pushbot merged 1 commit intoopencv:3.4from
Wenzhao-Xiang:master

Conversation

@Wenzhao-Xiang
Copy link
Copy Markdown
Contributor

@Wenzhao-Xiang Wenzhao-Xiang commented Jun 6, 2019

Fix #14734
Add utilt.loadOpenCv() at the beginning of main(), and set the original main() as its onloadCallback function.
Now the face recognition sample can load both opencv.js(asm.js) and opencv.js(WASM).

force_builders=Docs,Custom
buildworker:Custom=linux-1,linux-2,linux-4
docker_image:Docs=docs-js
docker_image:Custom=javascript

@Wenzhao-Xiang
Copy link
Copy Markdown
Contributor Author

@alalek Does it mean I need rebase this branch to branch 3.4? or master?

@alalek
Copy link
Copy Markdown
Member

alalek commented Jun 10, 2019

Yes, this patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, 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".

};

function main() {
// Create a camera object.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we can keep main function unchanged but do something like that:

function main() {
  // ...
}

utils.loadOpenCv(() => {
  main();
}

and

<body>

instead of

<body onload="main()">

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Thanks!

@Wenzhao-Xiang Wenzhao-Xiang changed the base branch from master to 3.4 June 13, 2019 02:42
@Wenzhao-Xiang
Copy link
Copy Markdown
Contributor Author

@alalek Thanks! Finished with rebase.

Copy link
Copy Markdown
Member

@dkurt dkurt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to merge, thank you! 👍

@opencv-pushbot opencv-pushbot merged commit 3f5c85e into opencv:3.4 Jun 20, 2019
@alalek alalek mentioned this pull request Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants