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

Posenet model that ml5 uses does not exist anymore. #512

Closed
Sblob1 opened this issue Jul 2, 2019 · 18 comments
Closed

Posenet model that ml5 uses does not exist anymore. #512

Sblob1 opened this issue Jul 2, 2019 · 18 comments

Comments

@Sblob1
Copy link

Sblob1 commented Jul 2, 2019

Hi. I am getting these errors with posenet in ml5's latest library:

Failed to load resource: the server responded with a status of 404 ()
https://storage.googleapis.com/tfjs-models/weights/posenet/mobilenet_v1_075/manifest.json
Is this because of the upgrade to posenet 2.0 ?

Apparently this model does not exist anymore?

Also get this error, perhaps related?

Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at XMLHttpRequest.r.onload (posenet.esm.js:2)

It seemed to be working earlier in the day, but the google github posenet model was updated just a few hours ago, and now not ml5 posenet is not working.

The ml5 examples on this page also have the same error with models not loading now too:
https://ml5js.org/reference/api-PoseNet/

Any help with this would be great!

Originally posted by @Sblob1 in #510 (comment)

@joeyklee
Copy link
Contributor

joeyklee commented Jul 2, 2019

@Sblob1 oh! Yikes, thanks so much for flagging this. We will look into this asap and circle back around when we've got news and a solution.

Thank you!

@joeyklee
Copy link
Contributor

joeyklee commented Jul 2, 2019

Tagging these other issues. It's definitely time to start hosting models on our own servers I think!

@oveddan
Copy link
Contributor

oveddan commented Jul 2, 2019

This has just been fixed...it was an issue with the hosted models moving but they have been moved back to the proper url.

@Sblob1
Copy link
Author

Sblob1 commented Jul 2, 2019

That's great! Thanks for letting me know, and thanks for all the great work on ML5 too 🙂

@joeyklee
Copy link
Contributor

joeyklee commented Jul 2, 2019

@oveddan - Thanks so much for the update! I saw your repo here: https://github.com/oveddan/posenet-for-installations - should we do something similar for all the ml5 model dependencies? As noted in the comment above, we've been meaning to support ml5 to run offline and it seems like you've put a lot of nice work and thoughts into how this might look like! I'm happy to help/support/fork and build off this too.

@joeyklee
Copy link
Contributor

joeyklee commented Jul 2, 2019

@Sblob1 - I'll close this issue now that this is resolved. Thanks again for noting this!

@joeyklee
Copy link
Contributor

joeyklee commented Jul 2, 2019

@all-contributors please add @Sblob1 for bug

@allcontributors
Copy link
Contributor

@joeyklee

I've put up a pull request to add @Sblob1! 🎉

@oveddan
Copy link
Contributor

oveddan commented Jul 2, 2019

@joeyklee I think letting people load the models offline totally makes sense and would be super helpful!

That being said I don't think it makes sense for us to host the models ourselves. This was just a one time issue, and also hosting things on a cdn costs money, so we may as well leave them on the google servers for people to download, and also with their cdn the users download the models from the node closest to them.

The way posenet for installations does it is it first downloads all possible models to local file system, then serves them via the static bundle. I'm working on upgrading posenet-for-installations to download the v2 models to the local file system, so we can look at that code when it's done. For ml5 to do this it would require ml5 to either serve the files through a local http server, or through the bundle which is something we wouldn't want to do as it would significantly increase the size.

@nsthorat mentioned earlier the ability to call save - which saves the model to local storage so that it can be retrieved offline. Adding this to ml5 posenet would be great for many people. However, this wouldn't work with posenet 1.0 because that uses a legacy model format. With posenet 2.0 we could support something like this. I think this way would be the cleanest to implement and document. So we could add this as part of the upgrade to ml5 using posenet 2.0

@oveddan
Copy link
Contributor

oveddan commented Jul 2, 2019

Also posenet 2.0 supports loading a model from a custom url. So one thing we could do is provide a separate github repo/bundle that downloads the posenet models to the local file system and serves them off of a basic http server. Then with ml5 posenet the user could pass the url pointing to the local file server.

@joeyklee
Copy link
Contributor

joeyklee commented Jul 2, 2019

@oveddan - This is great feedback. Maybe a good balance then is to make it clear how people can do this in the case they would like to load models offline.

  • +1 to providing a separate github repo/bumdle that downloads the models so they can point to a local server. Maybe we can change ml5-models to be a repo with a few scripts that download the
    models locally and serve them up like:

download:

npm run download-model posenet
npm run download-model faceApi

then to serve:

npm run start

then the urls could just be:

https://localhost:3000/models/posenet
https://localhost:3000/models/faceApi

@oveddan
Copy link
Contributor

oveddan commented Jul 2, 2019

Yes something like this would be great!

@oveddan
Copy link
Contributor

oveddan commented Jul 2, 2019

After this discussion - for posenet-for-installations I'm going to move all the downloading and serving functionality to a separate repo. We can then import the downloading code into the ml5-models library or just copy and paste it.

@joeyklee
Copy link
Contributor

joeyklee commented Jul 2, 2019

@oveddan - Super. This is excellent. Thanks so much. We can try out what works best and roll out the bumps along the way. ✨

@Sblob1
Copy link
Author

Sblob1 commented Jul 2, 2019

@all-contributors please add @Sblob1 for bug

Wow, thanks for this super cool honour guys! Happy to be of help :)

@allcontributors
Copy link
Contributor

@Sblob1

I've updated the pull request to add @Sblob1! 🎉

@joeyklee
Copy link
Contributor

joeyklee commented Jul 2, 2019

@Sblob1 - sure thing! All contributions are welcome and appreciated. We are just waiting for the Continuous Integration tests to pass then we can merge the PR. Thanks again!

@komal1502
Copy link

Hi. I am getting these errors with posenet in ml5's latest library:

Failed to load resource: the server responded with a status of 404 () https://storage.googleapis.com/tfjs-models/weights/posenet/mobilenet_v1_075/manifest.json Is this because of the upgrade to posenet 2.0 ?

Apparently this model does not exist anymore?

Also get this error, perhaps related?

Uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse () at XMLHttpRequest.r.onload (posenet.esm.js:2)

It seemed to be working earlier in the day, but the google github posenet model was updated just a few hours ago, and now not ml5 posenet is not working.

The ml5 examples on this page also have the same error with models not loading now too: https://ml5js.org/reference/api-PoseNet/

Any help with this would be great!

Originally posted by @Sblob1 in #510 (comment)

Did you get the solution to it? as I am too facing the same issue. Would you please help me with it?

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

4 participants