WebDevSimplified / Face-Detection-JavaScript

986 stars 1.39k forks source link

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

Open guyyaffear opened 4 years ago

guyyaffear commented 4 years ago

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!.

samartinell commented 4 years ago

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 commented 4 years ago

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)