ml5-data-and-models-server
ml5-data-and-models-server copied to clipboard
Is it posible to load posenet?
Hello!
I used posenet this way:
Is it possible to use it in the same way with your repo offline? If yes how?
Thanks!
Hi!
Yes in v0.4.2
it is possible, however it requires a few steps:
- Clone this repo: https://github.com/ml5js/ml5-data-and-models-server. Follow the instructions here: https://github.com/ml5js/ml5-data-and-models-server#setup-
- In ml5, you'll make sure:
<script src="https://unpkg.com/[email protected]/dist/ml5.min.js"></script>
and in your sketch.js
posenet = ml5.poseNet("http://localhost:5000/posenet", video)
I haven't gotten around to documenting this or making a tutorial, but give this a try and let me know if this works! Thanks!
Thanks @joeyklee for this awesome work; Unfortunately I get 404 error, trying to load posenet. I use both http://localhost:5000/posenet and http://localhost:5000/posenet/mobilenet_v1_050/, Still it doesn't work.
same here. I also tried making the path part of the options. like so
let poseOptions = {
modelUrl: "http://localhost:5000/posenet",
detectionType: 'single'
};
poseNet = ml5.poseNet(video, poseOptions, modelReady);
I guess I am also a bit unclear about the location of where ml5-data-and-models-server-source
needs go in reference to my project folder.
right now I have:
+--myProject
| +--index.html
| +--script.js
| +--ml5-data-and-models-server-source
I cd to ml5-data-and-models-server-source
and call npn run serve
I should also mention that I used the Brackets IDE, which opens a live browser view at http://127.0.0.1:61583/index.html
Anybody got this working? I need to run PoseNet offline for an upcoming installation, so very interested in case someone figured this out :-)
yes I got it running locally.
added this to index.html
<script src="/libs/p5js/p5-0.9.0/p5.min.js"></script>
<script src="/libs/p5js/p5-0.9.0/addons/p5.dom.min.js"></script>
<script src="http://localhost:5000/ml5.min.js" type="text/javascript"></script>
before running my JS project that uses ml5js I did:
- in the terminal
cd
to your ml5-data-and-models-server folder - then type
npm install
and hit enter. but only for the first time you do this - then
npm run download:all
or if you do not want to wait long for it to download all model you could specifynpm run download:posenet
and maybe other models likenpm run download:posenet2
(see the readme in the ml5-data-and-models-server folder) - then type
npm run serve
and hit enter
Thanks @stephanschulz ! I followed the steps and seem to have downloaded the models + run them via npm, but it returns a 404:
GET http://localhost:5000/ml5.min.js net::ERR_ABORTED 404 (Not Found) sketch.js:21 Uncaught ReferenceError: ml5 is not defined at setup (sketch.js:21)
Any chance I could see your posenet code (html + js), to learn what I did wrong?
maybe the local server that ml5-data-and-models-server
starts has a different Port and is not 5000. the terminal should show you what port it uses when you start the npm run thing.
I will put together a simple example in a bit and post it here.
- here is a video of me starting the server and my example running using potent. https://www.dropbox.com/sh/z5n1udzvh5pb6m6/AAA6rbx7ke7LKyluHExQ2C8Ra?dl=0
- also included a screenshot show the included files and models needed.
- also find my PoseNet_webcam example
Wow, thank you so much @stephanschulz ! I got it working thanks to your guidance and example 🥳. Really appreciate all your help.
I have the same issue, I did exactly same(run the server and using bracket) I even couldn't find the ml5.min.js in the folder so tried to download it from the CDN and put it into the folder but still no luck... Any clues or solutions? Thank you