-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
getting error in fetching models and libraries #2
Comments
You need to be running the project as a server using something like vscode
live server extension. This will make it so that the models and such are
accessible in the way the library expects them to be.
…On Tue, Jun 25, 2019, 4:19 AM amitraja4606 ***@***.***> wrote:
Hi, I downloaded your code and face-api.js library too. But when running
index.html in browser I am getting blank page and below error.
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)
where am I missing something?
Thanks in advance.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2?email_source=notifications&email_token=AJPAR257N6OXTCSCNCB5363P4HPK3A5CNFSM4H3GGL2KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3PX2GA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJPAR256TO2NTWQMVZJR2LLP4HPK3ANCNFSM4H3GGL2A>
.
|
@WebDevSimplified Whenever I run it on port 8000 it runs, but it NEVER kills. Even when I run force killing commands to kill all activity on port 8000. Next time I open up the browser, without even initializing a new local server, it will open up again. Also, if I initialize it on a different port (eg. 1234) it throws errors to load the models and never runs. |
This sounds like it is a problem with the server setup you are using. Are you using live server through VSCode or some other server to load the pages? |
@WebDevSimplified I'm using edit: It's also sad, because it means I cannot add/adjust the code and play around with it. Eg. when I set it up to estimate gender and age, it also doesn't update. (yes I did save the file before running again) |
I am not familiar with that library, but most likely you need to configure the server so that the models are accessible via url as well. |
what do you mean accessible via urls? I'm giving it the direct path to the models. Even when I delete the entire folder with everything in it, kill my localhost:8000 (from terminal) and then check localhost:8000 it keeps connecting. |
The face-api library works by accessing the models via a URL, so your models must be available at that URL. For example |
@WebDevSimplified solved, for some reason they were cached in my chrome browser. When I do incognito it works correctly, or when I do "disable cache" in dev tools it also works as it should... |
That makes sense. You can also press |
I am running a file using xampp server coded in php. I am facing this issues. Is there any way that the face.api work in xampp server |
Any workaround if we wish to run it without the server? |
no use xampp server. https://www.apachefriends.org/download.html |
just install the live server in visual code |
Hi, I downloaded your code and face-api.js library too. But when running index.html in browser I am getting blank page and below error.
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)
where am I missing something?
Thanks in advance.
The text was updated successfully, but these errors were encountered: