oveddan / posenet-for-installations

Provides an ideal way to use PoseNet for installations; it works offline and broadcasts poses over websocket.
Apache License 2.0
132 stars 29 forks source link

Posenet Webscoket connection problem and other errors on Windows PC #4

Closed sambit2 closed 5 years ago

sambit2 commented 5 years ago

I was using Chrome and Windows 10 and in the last step I got this error as in the image below. Everything worked smoothly before that. Can you please let me know how to fix it? posenet_error Also tried with other browsers and using admin privilege in Chrome from cmd but apparently nothing worked out!

oveddan commented 5 years ago

Hi @sambit2 the first two errors (about the Grid) are ignorable. Just some css issues I need to fix.

The 3rd error is because it is trying to fetch the models, but it's getting a 404 (not found). Make sure to run the line:

yarn download-models

The 4th error is because you do not have the local node.js server running that communicates with the browser over websocket, and broadcasts the poses.

This application should give better error messages to make debugging those issues clearer.

Instead of doing yarn start, on windows, I would run each of the commands below in two separate tabs:

yarn start-client

yarn start-server

And see if there are any errors.

You could also run the command:

yarn build-and-distribute

which will create .exe files you can easily open on windows. You would then need to open both client/posenet.exe and server/posenetServer.exe

sambit2 commented 5 years ago

Hi @oveddan, Thank you for the elaborate response! Actually, I have already downloaded all the models before starting the client and server but may be I will try again.

Will load the models again and run the client and server in separate tabs and see if it works?

While building the executables, it asks me to use --build flag may be because I have a 64 bit version of windows. So, I get error. Do you know the exact command which I should use to build the .exe files OR may be it is related to the previous downloading all models thingy?

oveddan commented 5 years ago

I would also open the "network" tab in the chrome debugger to see if there are any issues downloading the models or connecting to the socket.

sambit2 commented 5 years ago

Hi @oveddan , I downloaded the models again. But, still I am getting the 3rd error and the models are never loaded. I tried to start the network tab in Chrome and then I see the loading time of the node modules is always pending. Can you please check that? Thank you! I tried to start the client and server in different tabs and the socket connection is working now.

oveddan commented 5 years ago

@sambit2 it appears the models were downloading to the wrong location. My apologies. I've pushed a fix. pull the latest and it should download to the right spot.

sambit2 commented 5 years ago

Hi @oveddan , Thank you! Now I can detect poses but I am not able to start the server and whenever I start then I get error. Is it because of the location thing in the current server folder? Should it also contain a public like client? Can you please look into it?

oveddan commented 5 years ago

@sambit2 whats the error you are getting?

sambit2 commented 5 years ago

2018-10-07T16_48_33_420Z-debug.log 2018-10-07T16_48_33_690Z-debug.log Hi @oveddan please check this log. To summarize, I think it cannot find index.js in the server.

sambit2 commented 5 years ago

Hi @oveddan , Strangely, after I did a yarn build and then opened the server and clients in separate tabs then I get no errors. So that issue is solved. I will try to build the executable and let you know if there is any issue. Can you please tell me how can I generate the json which stores the pose data that I see now live? Is there a way to increase the number of persons tracked simultaneously to more than 20? Just let me know and I can try to look into it?

oveddan commented 5 years ago

@sambit2 I will close this issue since it is resolved. The json data is sent over websocket. Anyone can subscribe to the socket at http://localhost:8000 and receive the poses json.

There should be examples for how to do this (see the other issues #1 #2 #3) that would provide sample code on how to do this.

Regarding the 20 people, it would be possible to increase the slider to allow up to more than 20, but likely the pose estimation api form PoseNet would not return that many. This is because it is using machine learning to estimate poses from what it sees in the picture, and likely it wouldn't find more than 20. You can edit the code locally to increase the slider and try it out. I would refer to the blog post on PoseNet to see how it works: https://medium.com/tensorflow/real-time-human-pose-estimation-in-the-browser-with-tensorflow-js-7dd0bc881cd5

Also...for future reference if there are other features/improvements you want please open a separate issue as that can contain its own discussion around the topic.

oveddan commented 5 years ago

You also may want to check out: https://runwayapp.ai/

It provides a bunch of different machine learning models which can be easily used to extract information from videos, and they have good examples/documentation on how to consume the data.