Skip to content

Generate and utilize a Pre-trained Model for Tensorflow.js

Notifications You must be signed in to change notification settings

purelyvivid/tfjs_model

Repository files navigation

Generate and Utilize Model Files for Tensorflow.js

  • How to Generate Model Files of tfjs (inclubing Structure and Weights) ?

    1. Need to install python library tensorflowjs first.
    pip install tensorflowjs
    1. Then convert models from Keras to Tensorflow.js (refer to here)
  • How to Utilize these Model Files?

    1. Publish Model Files to Web and get the Link of model.json. For this case, the URL is : http://mobilenet.purelyvivid_tfjs.nctu.me/tfjs_mobilenet/model.json
    2. Download https://github.com/tensorflow/tfjs-examples . In the folder of /mobilenet, open the file named index.js. Modify the const MOBILENET_MODEL_PATH = ... to the URL of your model.

    1. Confirm your Environment: (could refer to here if your OS is Ubuntu)

      Node.js >=8.9 and <9

      Yarn

    2. Run JS code

    yarn
    yarn watch
    
    1. Then you can see the result such like:

      Note: the text in above image is just for modification reference, not actually true.

About

Generate and utilize a Pre-trained Model for Tensorflow.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published