Skip to content

Added FaceDetectorYN to OpenCV JS API#25430

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/FaceDetectorYN_js
Apr 19, 2024
Merged

Added FaceDetectorYN to OpenCV JS API#25430
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/FaceDetectorYN_js

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov commented Apr 17, 2024

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 another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the 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
build_image:Docs=docs-js
build_image:Custom=javascript
buildworker:Custom=linux-1,linux-4,linux-f1

@asmorkalov
Copy link
Copy Markdown
Contributor Author

@opencv-alalek ONNX file is not stored in the repo. Do we need a test with always downloadable ONNX file? I suppose, no.

@WanliZhong
Copy link
Copy Markdown
Member

@asmorkalov I tried to build opencv.js, but I can't make it be imported successfully. Could you paste the opencv.js with FaceDetectorYN?

@asmorkalov
Copy link
Copy Markdown
Contributor Author

@WanliZhong I relay on BuildBot in this case. I'll try to reproduce it locally and send instruction.

@opencv-alalek
Copy link
Copy Markdown
Contributor

@WanliZhong you could download it from docs preview: https://pullrequest.opencv.org/buildbot/export/pr/25430/docs/opencv.js

@WanliZhong
Copy link
Copy Markdown
Member

@opencv-alalek I met the same problem as the package I built. The onRuntimeInitialized callback function will not be called in this opencv.js or which I built manually. But it works in release opencv.js version https://docs.opencv.org/master/opencv.js

<body onload="cv['onRuntimeInitialized']=()=>{ main() }">
<button id="startStopButton" type="button" disabled="true">Start</button>
<div id="status"></div>
<canvas id="output" width=640 height=480 style="max-width: 100%"></canvas>
<table>
<tr id="targetImgs"></tr>
<tr id="targetNames"></tr>
</table>
<button id="addPersonButton" type="button" disabled="true">Add a person</button>
</body>

@opencv-alalek
Copy link
Copy Markdown
Contributor

@WanliZhong
Copy link
Copy Markdown
Member

WanliZhong commented Apr 18, 2024

Does JS tutorial sample work for you? http://pullrequest.opencv.org/buildbot/export/pr/25430/docs/db/d64/tutorial_js_colorspaces.html

Yes, it works in Safari but not in local machine with Safari. I shouldn't use Safari. This problem seems browser related. It works well in Edge browser😂

Copy link
Copy Markdown
Contributor

@opencv-alalek opencv-alalek left a comment

Choose a reason for hiding this comment

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

Tutorial page would help with testing.

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.

3 participants