Git Product home page Git Product logo

simple-api-tensorflowjs's Introduction

About this repo

This repo is used for demo Bangkit Guest Speaker Session H2. The topic is about how to create API for machine learning inference.

Dependencies Project (main branch)

  1. Hapi Framework
  2. Tensorflow.js

Machine Learning Model

The model was made from course "Belajar Machine Learning untuk Pemula" and exported as Keras Model (.h5). After that, because this demo is use tensorflowjs, the model should be convert to tensorflow.js model.

Here is the code in Python how to convert keras model (.h5) to tensorflow.js model. Make sure your tensorflow.js already installed on your local computer.

from tensorflow.keras.models import load_model
import tensorflowjs as tfjs

model_path = load_model("<Path to your model>")
output_path = "<Output path after your model is converted>"

tfjs.converters.save_keras_model(model_path, output_path)

Or you can use bash.

tensorflowjs_converter --input_format=keras <path to your model> <output_path>

Installation

If you want to try this project,

  1. Clone this project
git clone https://github.com/dicodingacademy/simple-api-tensorflowjs.git
  1. Install dependencies
npm i
  1. Run development script
npm run dev

Deploy to Compute Engine Instance

Follow this step to deploy the apps to Compute Engine Instance

  1. Set firewall rule

Set the firewall rule for port 3000 (because this server is running on port 3000).

  1. Create your instance

Create your instance based on your preference and apply the firewall rule via target tags.

  1. Connect to the instance via SSH.
  2. Install Nodejs
  3. Follow the installation steps.

simple-api-tensorflowjs's People

Contributors

ridhaginanjar avatar

Stargazers

faqih-stwn avatar Muhammad Alif avatar Arya Baskara avatar Kevin Arnandes avatar Muhammad Rafi avatar

Watchers

oon arfiandwi avatar Nur Rohman avatar  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.