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

Is it posible to load posenet? #7

Open
Warholik opened this issue Nov 9, 2019 · 10 comments
Open

Is it posible to load posenet? #7

Warholik opened this issue Nov 9, 2019 · 10 comments

Comments

@Warholik
Copy link

Warholik commented Nov 9, 2019

Hello!

I used posenet this way:

<script src="https://unpkg.com/[email protected]/dist/ml5.min.js"></script> <script> let video = createCapture(VIDEO); let poseNet = ml5.poseNet(video); ... ... </script>

Is it possible to use it in the same way with your repo offline?
If yes how?

Thanks!

@joeyklee
Copy link
Collaborator

Hi!

Yes in v0.4.2 it is possible, however it requires a few steps:

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

@reza7rm
Copy link

reza7rm commented Mar 24, 2020

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.

@stephanschulz
Copy link

stephanschulz commented May 21, 2020

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

@AndreasRef
Copy link

Anybody got this working? I need to run PoseNet offline for an upcoming installation, so very interested in case someone figured this out :-)

@stephanschulz
Copy link

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 specify npm run download:posenet and maybe other models like npm run download:posenet2 (see the readme in the ml5-data-and-models-server folder)
  • then type npm run serve and hit enter

@AndreasRef
Copy link

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?

@stephanschulz
Copy link

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.

@stephanschulz
Copy link

@AndreasRef
Copy link

Wow, thank you so much @stephanschulz ! I got it working thanks to your guidance and example 🥳. Really appreciate all your help.

@viswongdev
Copy link

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

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

6 participants