Face-Detection-JavaScript icon indicating copy to clipboard operation
Face-Detection-JavaScript copied to clipboard

Failed to load resource with live server on

Open Lorraine99 opened this issue 5 years ago • 3 comments

Hi! I got error like this: Failed to load resource: the server responded with a status of 404 (Not Found) face-api.min.js:1 Uncaught (in promise) Error: failed to fetch: (404) Not Found, from url: http://127.0.0.1:5501/models/tiny_face_detector_model-weights_manifest.json at face-api.min.js:1 at face-api.min.js:1 at Object.next (face-api.min.js:1) at n (face-api.min.js:1) :5501/models/face_landmark_68_model-weights_manifest.json:1 Failed to load resource: the server responded with a status of 404 (Not Found) :5501/models/face_recognition_model-weights_manifest.json:1 Failed to load resource: the server responded with a status of 404 (Not Found) :5501/models/face_expression_model-weights_manifest.json:1 Failed to load resource: the server responded with a status of 404 (Not Found)

I clone the repository without changing anything, not sure what's wrong.

Lorraine99 avatar Feb 11 '20 15:02 Lorraine99

@Lorraine99 it looks like the issue is related to the models. I'd try to create the project from scratch rather than copying cloning. Things usually work out better for me that way and I was able to fire this up in 10 mins.

jcrommar avatar Feb 17 '20 07:02 jcrommar

It seems to be related to this:

In response to CVE-2019-11730, Firefox 68 and later define the origin of a page opened using a file:/// URI as unique. Therefore, other resources in the same directory or its subdirectories no longer satisfy the CORS same-origin rule. This new behavior is enabled by default using the privacy.file_unique_origin preference.

ref -> https://developer.mozilla.org/it/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp

for each weight file inside "models" folder called from face-api.js through script.js

Fantantonio avatar Apr 18 '20 13:04 Fantantonio

I think @Lorraine99 you are not using a web server. Try to put all the files inside the localhost and access them by http://localhost/path/of/file.html

Fantantonio avatar Apr 20 '20 08:04 Fantantonio