8000 how can i make this app work without internet? · Issue #17 · andypotato/fingerpose · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

how can i make this app work without internet? #17

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

Open
owais142002 opened this issue Sep 26, 2021 · 6 comments
Open

how can i make this app work without internet? #17

owais142002 opened this issue Sep 26, 2021 · 6 comments

Comments

@owais142002
Copy link

No description provided.

@andypotato
Copy link
Owner

You need to download all external scripts (tfjs, handpose) plus the model weights. Then you can either run your application through a local web server or simply package everything into a standalone Electron App.

@gwitchel
Copy link

in dist/index.js change the script tag from

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core%22%3E</script> <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-converter%22%3E</script> <script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/handpose%22%3E</script> <script src="fingerpose.js" type="text/javascript"></script>

to

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script> <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-converter"></script> <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl"></script> <script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/handpose"></script> <script src="fingerpose.js" type="text/javascript"></script>

which allows you to run locally in the browser.

@owais142002
Copy link
Author
owais142002 commented Sep 28, 2021

You need to download all external scripts (tfjs, handpose) plus the model weights. Then you can either run your application through a local web server or simply package everything into a standalone Electron App.

Thanks for reply sir but can u pls guide more cause i was not able to do it. Please help :)

@owais142002
Copy link
Author
owais142002 commented Sep 28, 2021

image

i have imported the installed modules in a separate js script like:
import * as handpose from '.\node_modules@tensorflow-models/handpose';
import * as tf from '.\node_modules@tensorflow/tfjs';

@andypotato
Copy link
Owner

You shouldn't import modules like this.

To make my example run offline you can take the following steps:

  1. Download all the scripts referenced in index.html (fingerpose.js, tfjs and the handpose model)
  2. Run index.html locally and check the download URLs for the model weights in Chrome inspector. You will notice a number of files are downloaded from tfhub.dev.
  3. Download these files manually and store them alongside your application
  4. Grep the handpose source for tfhub.dev, you should find the hardcoded download URLs for the model weights. Replace them one by one with your local URLs
  5. Enjoy your offline version

@f5scott
Copy link
f5scott commented Jan 9, 2023

You would have to manually change the hardcoded HANDDETECT_MODEL_PATH within the package someone really should make a fork that accepts a prop for this, strange that it does not already.

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
0