Code Monkey home page Code Monkey logo

aws-flask's Introduction

AWS-Flask

Description

A Flask app that allows a user to upload images and automatically generate meaningful labels. The app runs on an EC2 cluster and makes use of the boto3 library to leverage several AWS services, authentication & authorization, image recognition and label generation, queueing, distributed computation and storage of binary and relational data. Inspired by the edx.org course AWS Fundamentals.

AWS services leveraged:

  • EC2, for deployment of web servers and load balancer on appropriate availability zones.
  • S3, for storage of binary images.
  • RDS, for storage of image labels generated by Rekognition.
  • Rekognition, for detecting key points in images and generating meaningful labels.
  • Cognito, for authorization and authentication.
  • SQS, for queueing image upload requests.
  • Lambda, to make the image recognition component asynchronous and avoid having the frontend "hang" on the user.

Contents

  • Deploy: scripts to initialize the environment for the entire application. Since the application is run on an EC2 "free" allocation, we frequently terminate and restart EC2 and RDS services. The scripts in this directory allow a fresh EC2-hosted OS to download some necessary packets and initialize nginx appropriately.
  • SetupScripts: A Python function that sets up the RDS database needed to store image labels.
  • FlaskApp: In many ways the "meat" of the project, especially application.py. The reader is encouraged to read through the comments ofapplication.py for an explanation of the flow of a user request through the various routes that the app listens to. Additional Python files exist, for storing sensitive information (e.g Cognito access keys / secrets) in environment variables, and for wrapping around SQL queries.
  • LambdaImageLabels: Contains code that would otherwise be in FlaskApp/application.py, such that Amazon Lambda can use the Rekognition routines outside the EC2 server and asynchronously return the results to the user.
  • SqsLongPoll: implementation of a long polling function for receiving notifications of image uploads from S3.

LICENSE

Refer to the comments in the individual source files for details.

aws-flask's People

Contributors

jasonfilippou avatar

Watchers

James Cloos 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.