tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.52k stars 1.94k forks source link

[Question] Performance issue with the body-pix model #4342

Closed LoSunny closed 3 years ago

LoSunny commented 3 years ago

https://stackoverflow.com/questions/65101541/performance-issue-with-the-body-pix-model

I'm having issue with the node performance, while someone suggested that https://www.tensorflow.org/js/guide/nodejs#production_considerations But I don't know how to implement a worker

rthadur commented 3 years ago

Can you please refer to this links https://medium.com/@wl1508/webworker-in-tensorflowjs-49a306ed60aa https://medium.com/@wl1508/webworker-in-tensorflowjs-49a306ed60aa as how to implement web worker. Currently we do not have working example. Thank you

LoSunny commented 3 years ago

But how do I send the data to the worker for it to process the information? Also, do I initialise the tf modal in the worker? Or pass it with the data?

EDIT: I've finally found a way to apply workers, but it made the problem even worst! Link: https://stackoverflow.com/questions/65101541/performance-issue-with-the-body-pix-model

vladmandic commented 3 years ago

@LoYungSum if you want, take a look at example https://github.com/vladmandic/human/blob/main/demo/browser.js that has both standard and webworker workflows (just look at useWorker flag).

LoSunny commented 3 years ago

I'll take a look at it, thanks for the suggestion

vladmandic commented 3 years ago

also, a thread on web worker performance issues: https://github.com/vladmandic/human/issues/2

google-ml-butler[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.

google-ml-butler[bot] commented 3 years ago

Closing as stale. Please @mention us if this needs more attention.