Giter Club home page Giter Club logo

fullstackwithlawrence / aws-rekognition Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 20.69 MB

A facial recognition micro service

Home Page: https://www.youtube.com/@FullStackWithLawrence

License: GNU Affero General Public License v3.0

Makefile 2.94% HCL 30.05% Python 62.15% Shell 1.57% Smarty 0.95% JavaScript 2.04% Dockerfile 0.30%
aws rekognition rekognition-workshop 12-factor ci-cd dependabot github-actions lambda mergify pre-commit-hooks python terraform api-gateway rekognittion aws-rekognition automated-testing docker-compose lambda-functions

aws-rekognition's Introduction

AWS Rekognition REST API

FullStackWithLawrence
Python Amazon AWS Terraform
12-Factor Unit Tests GHA pushMain Status Auto Assign Release Notes License: AGPL v3 hack.d Lawrence McDaniel

A facial recognition microservice built with AWS Rekognition, DynamoDB, S3, IAM, CloudWatch, API Gateway and Lambda. See this json dump for configuration options.

Usage

Index and store a face print:

curl --location --globoff --request PUT 'https://api.rekognition.yourdomain.com/v1/index/Image-With-a-Face.jpg' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: text/plain' \
--data '@'

Search an image for known faces:

curl --location --globoff --request PUT 'https://api.rekognition.yourdomain.com/v1/search/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: text/plain' \
--data '@/Users/mcdaniel/Desktop/aws-rekognition/test-data/Different-Image-With-Same-Face.jpg'

Quickstart Setup

This is a fully automated build process using Terraform. The build typically takes around 60 seconds to complete. If you are new to Terraform then please review this Getting Started Guide first.

Configure Terraform for your AWS account. Set these three values in terraform.tfvars:

account_id           = "012345678912"   # your 12-digit AWS account number
aws_region           = "us-east-1"      # an AWS data center
aws_profile          = "default"        # for aws cli credentials

Build and configure AWS cloud infrastructure:

cd terraform
terraform init
terraform plan
terraform apply

API Features

  • Highly secure. This project follows best practices for handling AWS credentials. The API runs over https using AWS managed SSL/TLS encryption certificates. The API uses an api key. User data is persisted to a non-public AWS S3 bucket. This api fully implements CORS (Cross-origin resource sharing). Backend services run privately, inside an AWS VPC, with no public access.
  • Cost effective. In most cases the running cost of this API remains within AWS' free usage tier for most/all services.
  • CloudWatch logs for Lambda as well as API Gateway.
  • AWS serverless implementation using AWS API Gateway, AWS DynamoDB, and AWS Lambda.
  • Meta data endpoint /info that returns a JSON dict of the entire platform configuration.
  • Robust, performant and infinitely scalable.
  • AWS API Gateway usage policy and managed api key.
  • Preconfigured Postman files for testing.

Requirements

Documentation

Please see this detailed technical summary of the architecture strategy for this solution.

Support

To get community support, go to the official Issues Page for this project.

Good Coding Best Practices

This project demonstrates a wide variety of good coding best practices for managing mission-critical cloud-based micro services in a team environment, namely its adherence to 12-Factor Methodology. Please see this Code Management Best Practices for additional details.

We want to make this project more accessible to students and learners as an instructional tool while not adding undue code review workloads to anyone with merge authority for the project. To this end we've also added several pre-commit code linting and code style enforcement tools, as well as automated procedures for version maintenance of package dependencies, pull request evaluations, and semantic releases.

Contributing

We welcome contributions! There are a variety of ways for you to get involved, regardless of your background. In addition to Pull requests, this project would benefit from contributors focused on documentation and how-to video content creation, testing, community engagement, and stewards to help us to ensure that we comply with evolving standards for the ethical use of AI.

For developers, please see:

You can also contact Lawrence McDaniel directly.

aws-rekognition's People

Contributors

lpm0073 avatar dependabot[bot] avatar mergify[bot] avatar actions-user avatar github-actions[bot] avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

bonythomasv

aws-rekognition's Issues

๐Ÿ› /index returns status code 200 even when the upload fails

Describe the bug
When uploading images using the /index end point, the return code is always 200, even if the upload failed. the following screen shot of the CloudWatch log shows three failed uploads, but I received a 200 response in each of these cases.

Screenshot 2023-12-15 at 2 58 14โ€ฏp m

Workflow
upload any image to /index

Expected behavior

  • if the return is 200 then the image should have uploaded.
  • if the upload failed for any reason then the return code should not be 200

Additional context

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.