Git Product home page Git Product logo

tfjs-workshop's Introduction

tfjs-workshop

Contains material for a TensorFlow.js workshop.

$ git clone [email protected]:Machine-Learning-Tokyo/tfjs-workshop.git

Prerequisites

To install nodejs, using nvm is recommended.

web

web-js

They are simple application of image classification using MobileNet which is a light weight model for image classification.

Step 1. Run demo application with initial model

Web application demonstrating image classfication using MobileNet. The application classified the given image. The initial model will be downloaded from TensorFlow Hub that is a registry for publishing pretrained deep learning models.

$ cd web 
# Or
$ cd web-js

$ yarn
$ npx parcel src/index.html --open

It will automatically launch the webapp to classify the given image. Please look into index.html to change the image to be predicted. That application is based on MobileNet demo in tfjs-models.

Step 2. Train your own model in Colab

Now you can your own model in Google Colab with the image you have. Please refer to the instruction in colab notebook. You can upload a image as the dataset used for training.

tfjs-converter is a tool to make a model readable by TensorFlow.js from pre-trained model by TensorFlow. It supports SavedModel, Keras model and so on. The colab gives you the model in the format imporable to TensorFlow.js.

Step 3. Run the demo application again with your own model.

The application can load the pre-trained model in tfjs_layers_model. After the application is launched, the model should be put in the dist directory so that the application can load the model. You can find the template to create the loadable model in Google Colab.

$ cp -R ~/Downloads/mymobilenet.zip dist
$ cd dist && unzip mymobilenet.zip
$ npx parcel src/index.html --open

It is also necessary to change the code to switch the loaded model.

Step 4. Publish the application in the internet

You can publish the application in the internet by using GitHub pages. Please follow the instruction in GitHub pages to bootstrap the site. Once the repository is prepared, copy the artifacts of the application in dist to the repository.

$ cd username.github.io
$ mv /path/to/tfjs-workshop/web/dist .
$ git add --all
$ git commit -m "Initial commit"
$ git push -u origin master

Then your will see the application in http://username.github.io.

tfjs-workshop's People

Contributors

lewuathe avatar reiinakano avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.