Coder Social home page Coder Social logo

food_classifier_tf2_gcloud_run's Introduction

Food Classifier App with TensorFlow 2 model on Google Cloud Run

This repo contains a web app for classifying 3 types of local Singaporean Food using the following APIs and platforms

  • TensorFlow 2: using tf.image, tf.keras.models and tf.data (for training)
  • Google Cloud Platform: Cloud Run, Cloud Build, Cloud Storage
  • Starlette, a lightweight ASGI framework/toolkit

Deploy with Google Cloud Run

Pre-requisites

  • Google Cloud Account
  • Enable Cloud Run and Cloud Build API

Deploy

To run the webapp on Google Cloud Run, launch Cloud Shell from your Dashboard.

  • export PROJECT_ID={your project id here}
  • Run gcloud config set project $PROJECT_ID
  • Run git clone https://github.com/yoke2/food_classifier_tf2_cloud_run.git
  • Change directory: cd food_classififer_tf2_cloud_run
  • Build container image with Google Cloud Build by running gcloud builds submit --tag gcr.io/$PROJECT_ID/food_classifier
    • If prompted that Cloud Build API not enabled on the project, enter 'y' to enable and retry
  • Deploy container built: gcloud run deploy --image gcr.io/$PROJECT_ID/food_classifier --platform managed --allow-unauthenticated --memory 1024M
    • You will be prompted for the service name: press Enter to accept the default name
    • You will be prompted for region: select the region us-central1
  • You will receive an URL to access the app. This can be seen on the Cloud Run page for dimsumapp in the Dashboard as well

Docker Installation

You can test your changes locally by installing Docker and using the following command:

docker build -t food-tf2-cr . && docker run --rm -it -p 8080:8080 food-tf2-cr

Local Installation

  • Install dependencies
$ pip install packaging
$ pip install -r requirements.txt

Run app

$ python app/server.py serve

Reference

food_classifier_tf2_gcloud_run's People

Contributors

isunyoo avatar

Watchers

 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.