Skip to content

Serverless Website to test various deeplearning models.

Notifications You must be signed in to change notification settings

cnv1989/ServerlessCV

Repository files navigation

Serverless Computer Vision

This repo is an attempt at setting up serverless computer vision applications using AWS services. For this implementation I have used TensorFlow but the stack can be used with any application/framework.

You can leverage this package and its packages to build your own pipeline using AWS.

Frontend

Backend

Deployment & Testing

Stack Files

  • cfn-template.yml - Cloudformation template to setup necessary S3 buckets, Cognito Authentication, IAM roles and policies
  • template.yml - Contains SAM template for Lambda function and API Gateway
  • swagger.yml - Contains API specifications
  • run.sh - Bash script containing all the necessary commands to setup and deploy the stack.

Stack

Requirements

Setup Instructions

  1. Setup virtualenv and install node_modules
    bash run.sh setup
  1. Create IAM user on AWS with admin access and use the access_key and secret_key to configure aws credentials locally.
    bash run.sh aws_config
  1. Copy/Download the model(s) into /models directory. You can use my Yolo model for this setup
    wget https://www.dropbox.com/s/h8ywy9lp8siw0ml/yolo_tf.pb -P models/
  1. Deploy the entire stack
    bash run.sh deploy

OR

  1. Deploy the basic stack containing S3, Cognito and IAM.
    bash run.sh deploy_stack
  1. Upload model(s) to S3 bucket.
    bash run.sh deploy_model
  1. Build and deploy static assest i.e entire frontend built using React
    bash run.sh deploy_website
  1. Build and deploy lambdas
    bash run.sh deploy_lambdas

Development & Testing

  • Follow the first 4 steps from setup instructions.

  • Start the api locally

    npm run sam local start-api
    npm run watch
  • Open http://localhost:3000/ in the browser

  • Drop images in the application to upload them to S3.

  • If you want to debug the function you can invoke the function locally once the images are in S3. The will generate better logs.

    npm run sam local invoke ProcessImage -- --event fixtures/ProcessImage.json

Webpage

Webpage

Lambda Limits

  • Code Size: 261 Mb
  • Persistant Storage: 512 Mb

About

Serverless Website to test various deeplearning models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published