Skip to content
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

Face detection on different browser #73

Closed
habibhajar opened this issue Aug 18, 2018 · 6 comments
Closed

Face detection on different browser #73

habibhajar opened this issue Aug 18, 2018 · 6 comments

Comments

@habibhajar
Copy link

Hi firstly i want to thank you for this amazing API that help me a lot for my project !!
So:

  • I use it in Firefox and it works fine but sometimes it gives me this error : "a web page slows down your browser" and blocks the browser .
  • When i use it in Chrome it not work and return this error :
    error
    if you can help me to solve this !!
@justadudewhohacks
Copy link
Owner

Hi,
you can not simply fetch files from your file system in the browser. That's why you get this error.

Either host your model file on localhost via an express server for example, or implement a filepicker to upload the model file.

@habibhajar
Copy link
Author

habibhajar commented Aug 18, 2018

Hi,
Why i can not ? either the same page works fine in Firefox !
and sorry for this question but "Either host your model file on localhost via an express server for example, or implement a filepicker to upload the model file." i don't get it and how i can do that i am a beginner in js ...
ps: this page is hosted in localhost

@justadudewhohacks
Copy link
Owner

justadudewhohacks commented Aug 18, 2018

Hmm, that's odd. Usually browsers don't allow you to access files from your filesystem for security reasons, that's why the fetch request in model.load is failing in chrome (not sure why this works for you in firefox).

If you look at my examples in this repo, you can see that I state, which folders can be publicly accessed (in server.js). This way you can load your model from an url e.g. net.load('models/my-model'). You can do the same for your model.

With filepicker I mean, you can use an input element of type 'file', which is another way to browse and load files from your browser. There should be plenty of tutorials out there, explaining how to implement a file upload.

@habibhajar
Copy link
Author

okey thanks a lot for your explanation and for the second : a web page slows down your browser" and blocks the browser :
error

@justadudewhohacks
Copy link
Owner

justadudewhohacks commented Aug 18, 2018

Isn't this just a warning? When exactly does this appear, when loading the model or during inference?

Edit: I think this just pops up when the event loop is blocked for some amount of time, essentially saying, that the main thread is not reacting to any interaction while blocked.

@habibhajar
Copy link
Author

yes it is just a warning and it happen during loading the model !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants