opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
75.69k stars 55.61k forks source link

Added FaceDetectorYN to OpenCV JS API #25430

Closed asmorkalov closed 1 week ago

asmorkalov commented 2 weeks ago

Pull Request Readiness Checklist

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

force_builders=Custom
build_image:Docs=docs-js
build_image:Custom=javascript
buildworker:Custom=linux-1,linux-4,linux-f1
asmorkalov commented 2 weeks ago

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

WanliZhong commented 2 weeks ago

@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 commented 2 weeks ago

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

opencv-alalek commented 2 weeks ago

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

WanliZhong commented 2 weeks ago

@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 https://github.com/opencv/opencv/blob/a1e4444fb5ce9ee3d4afa80073e49dcc7ed6c6dd/samples/dnn/js_face_recognition.html#L193-L203

opencv-alalek commented 2 weeks ago

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

WanliZhong commented 2 weeks ago

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😂