Giter VIP home page Giter VIP logo

serverless-image-object-detection's Introduction

serverless-image-object-detection

A basic static site that allows users to upload an image and get back the predicted objects in the image. Built on top of S3, Lambda, API Gateway, Rekognition, DynamoDB, and the Chalice framework.

alt text

Setup

Create and activate virtual environment

python3 -m venv venv
source venv/bin/activate

Install dev dependencies

pip install -r dev-requirements.txt

This project uses Terraform to deploy resources to AWS (see here for installation instructions).

Create a new terraform/config/backend-env.conf file from terraform/config/backend-env.conf.sample (replace env with either dev or prod). Similarily, create a new terraform/config/env.tfvars file terraform/config/env.tfvars.sample.

The Terraform calls are wrapped in invoke tasks. To deploy, run

invoke deploy -e dev

If everything is successful, the site should be deployed at

http://<site_bucket_name>.s3-website-<region>.amazonaws.com/

To cleanup and destroy resources

invoke tf-destroy

Architecture

alt text

The site is hosted as a static site in an S3 bucket. When a user uploads a file, a POST request is made to API Gateway, which fires off a Lambda (API Gateway is configured to use Lambda proxy integration). The Lambda checks the hash of the file to see if it exists in the input S3 bucket. If it exists, then a prediction was made against the image in the past and we grab the prediction from DynamoDB and the output image from the output bucket. If the image does not exist, then the following series of events happen:

  • Get image predictions from Rekognition
  • Store predictions in DynamoDB
  • Store output image with bounding box in output bucket

Finally, the resulting prediction and output images are sent back and displayed to the client

serverless-image-object-detection's People

Contributors

andyhuynh3 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.