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

face-api.min.js:1 Fetch API cannot load

Open guyyaffear opened this issue 5 years ago • 2 comments

error it is not working i saw in the previous issues that you said to connect it to the sever i i connect it to local server and it is still not working.

face-api.min.js:1 Fetch API cannot load file:///C:/models/tiny_face_detector_model-weights_manifest.json. URL scheme must be "http" or "https" for CORS request. (anonymous) @ face-api.min.js:1 face-api.min.js:1 Fetch API cannot load file:///C:/models/face_landmark_68_model-weights_manifest.json. URL scheme must be "http" or "https" for CORS request. (anonymous) @ face-api.min.js:1 face-api.min.js:1 Fetch API cannot load file:///C:/models/face_recognition_model-weights_manifest.json. URL scheme must be "http" or "https" for CORS request. (anonymous) @ face-api.min.js:1 face-api.min.js:1 Fetch API cannot load file:///C:/models/face_expression_model-weights_manifest.json. URL scheme must be "http" or "https" for CORS request. (anonymous) @ face-api.min.js:1 face-api.min.js:1 Uncaught (in promise) TypeError: Failed to fetch at face-api.min.js:1 at face-api.min.js:1 at Object.next (face-api.min.js:1) at face-api.min.js:1 at new Promise () at p (face-api.min.js:1) at lp (face-api.min.js:1) at face-api.min.js:1 at face-api.min.js:1 at Object.next (face-api.min.js:1)

thank you for the help!.

guyyaffear avatar Jul 14 '20 14:07 guyyaffear

I think you should run the site through http server (download Node js, then create 2 cmd file in script folder, one with "npm install http-server -g", and the second one with "http-server", run them), but.... I had the same problem and after this "fix" the problems ran away, but script still shows nothing. sorry for poor english, i'm from Russia :)

samartinell avatar Sep 15 '20 07:09 samartinell

Hey, bro, I'm not sure, but it's maybe can help you too. I fixed the problem with "live server" plugin in visual studio. So, just install it and run the index.html through live server (RMB on file)

samartinell avatar Sep 15 '20 07:09 samartinell