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
Bug: CORS fetching model face-detection #908
Comments
Same issue for: |
Same issue for: |
We are facing the same issues with blazeface library, it is a site breaking bug for us too. I would really appreciate any help with this.
|
Hi all, we're looking into this issue. Thanks for your patience. |
For those who are with this problem, let me tell you I fixed doing that:
|
I tried doing the same. const detectorConfig = { I also tried writing a different API that fetches the model from kaggle url, adds CORS headers and sends to front end.
However, in both cases, the weights need to be loaded from the same kaggle URL and I am not finding how to download it? Any suggestions on fixing this would be helpful. The issue is happening in our live Production environment . |
Hi all, we rolled out a fix for the issue. You should hopefully start to see the model load from Thanks again for your patience! |
@pranjalieedee I don't know exactly what issue you're hitting without logs and/or a repro of your dev environment. But I know for self-hosting the model, you will need to host all the tfjs model files (
The intermediate API code snippet you shared only fetches the
For TF.js to work on the frontend, you'll need to handle fetching all the other |
Thank you. I downloaded the files from https://www.kaggle.com/models/google/movenet/frameworks/tfJs/variations/singlepose-lightning/versions/4 and am serving them locally. We have been able to get the system up and running. |
What happened?
I am using:
@tensorflow-models/face-detection & @mediapipe/face_detection
All worked fine until this morning in local and all deployed environmets. But now we are receiving this CORS error:
Access to fetch at 'https://www.kaggle.com/models/mediapipe/face-detection/frameworks/tfJs/variations/short/versions/1/model.json?tfjs-format=file&tfhub-redirect=true' (redirected from 'https://tfhub.dev/mediapipe/tfjs-model/face_detection/short/1/model.json?tfjs-format=file') from origin 'https://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Relevant code
Relevant log output
`Access to fetch at 'https://www.kaggle.com/models/mediapipe/face-detection/frameworks/tfJs/variations/short/versions/1/model.json?tfjs-format=file&tfhub-redirect=true' (redirected from 'https://tfhub.dev/mediapipe/tfjs-model/face_detection/short/1/model.json?tfjs-format=file') from origin 'https://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.`
tensorflow_hub Version
0.12.0 (latest stable release)
TensorFlow Version
2.8 (latest stable release)
Other libraries
No response
Python Version
3.x
OS
Linux
The text was updated successfully, but these errors were encountered: