-
Notifications
You must be signed in to change notification settings - Fork 33
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
Issue replicating face recognition example: CORS errors and invalid signature
when trying to load model weights
#285
Comments
invalid signature
when trying to load model weights
this is to prevent cross site scripting attacks, an you try hosting a copy of the model weights on your own domain name, so that the origin of the html and the model weights are by the same source? |
Thank you! Yes, I have been trying to host the model weights on my own domain name (https://jaanli.github.io/heartbeat/test-data/weights has the weights). For example, this path works: However, the error in the console says |
Ok, found the issue! Indeed as @endomorphosis pointed out the issue was the paths. In vite, I had to add the model weights files from https://jaanli.github.io/heartbeat/ now mirrors the example here: https://webmachinelearning.github.io/webnn-samples/face_recognition/ Thank you!! I will try implementing a heart rate detection algorithm next. FYI, it is still quite difficult to understand how to run these examples as standalone webapps; a simpler tutorial or easier to understand code would be nice - if you look at https://github.com/jaanli/heartbeat/ you can see that there were a number of changes required from code in this repository (https://github.com/webmachinelearning/). I reopened the issue for visibility, as hopefully someone can address the cloudfront URL and the need to host the model weights in the public directory to make the examples easier to use for newcomers. |
Here is how I fixed it:
This is important for others trying to deploy to GitHub pages as well like where these demos are hosted at :) Hopefully this helps improve the awesome examples! My next step will be saving this video locally for analysis. |
Thanks @endomorphosis, and thanks @jaanli for the patience and improved the code of weightsOrigin() function. Indeed I limitted the model files acess from https://webmachinelearning.github.io/ only in AWS, submitted a README PR in #292 . |
Hi! Thank you for all of the help here :)
I am having issues replicating the face recognition demonstration from scratch. Here are the steps I followed:
face_recognition
folder to the repo: https://github.com/webmachinelearning/webnn-samples/tree/master/face_recognitioncommon
folder to the repo: https://github.com/webmachinelearning/webnn-samples/tree/master/commongit clone --recurse-submodules https://github.com/webmachinelearning/webnn-samples
(thanks to @Honry in Face recognition example does not work locally on latest Chrome Canary:Invalid signature.
#282) and copy thetest-data
folder with the model weights: https://github.com/jaanli/heartbeat/tree/main/test-data/models/ssd_mobilenetv2_face_nhwcCORS errors
It seems like the example does not use the weights file that points to the
test-data
even though it is in the repository.Here's a screenshot if needed of what happens in chrome canary when navigating to the repository github page: https://jaanli.github.io/heartbeat/
Locally, the errors say
invalid signature
in Numpy:Any advice on how to fix this to get the example working? Thanks so much!
The text was updated successfully, but these errors were encountered: