Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fullstackwithlawrence/aws-rekognition
A facial recognition micro service
https://github.com/fullstackwithlawrence/aws-rekognition
12-factor api-gateway automated-testing aws aws-rekognition ci-cd dependabot docker-compose github-actions lambda lambda-functions mergify pre-commit-hooks python rekognition rekognition-workshop rekognittion terraform
Last synced: 8 days ago
JSON representation
A facial recognition micro service
- Host: GitHub
- URL: https://github.com/fullstackwithlawrence/aws-rekognition
- Owner: FullStackWithLawrence
- License: agpl-3.0
- Created: 2023-09-03T18:20:49.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-10T00:54:22.000Z (7 months ago)
- Last Synced: 2024-04-10T03:01:01.473Z (7 months ago)
- Topics: 12-factor, api-gateway, automated-testing, aws, aws-rekognition, ci-cd, dependabot, docker-compose, github-actions, lambda, lambda-functions, mergify, pre-commit-hooks, python, rekognition, rekognition-workshop, rekognittion, terraform
- Language: Python
- Homepage: https://www.youtube.com/@FullStackWithLawrence
- Size: 20.1 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# AWS Rekognition REST API
[![FullStackWithLawrence](https://a11ybadges.com/badge?text=FullStackWithLawrence&badgeColor=orange&logo=youtube&logoColor=282828)](https://www.youtube.com/@FullStackWithLawrence)
[![Python](https://a11ybadges.com/badge?logo=python)](https://www.python.org/)
[![Amazon AWS](https://a11ybadges.com/badge?logo=amazonaws)](https://aws.amazon.com/)
[![Terraform](https://a11ybadges.com/badge?logo=terraform)](https://www.terraform.io/)
[![12-Factor](https://img.shields.io/badge/12--Factor-Compliant-green.svg)](./doc/Twelve_Factor_Methodology.md)
[![Unit Tests](https://github.com/FullStackWithLawrence/aws-rekognition/actions/workflows/tests.yml/badge.svg)](https://github.com/FullStackWithLawrence/aws-rekognition/actions)
![GHA pushMain Status](https://img.shields.io/github/actions/workflow/status/FullStackWithLawrence/aws-rekognition/pushMain.yml?branch=main)
![Auto Assign](https://github.com/FullStackwithLawrence/aws-rekognition/actions/workflows/auto-assign.yml/badge.svg)
[![Release Notes](https://img.shields.io/github/release/FullStackWithLawrence/aws-rekognition)](https://github.com/FullStackWithLawrence/aws-rekognition/releases)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![hack.d Lawrence McDaniel](https://img.shields.io/badge/hack.d-Lawrence%20McDaniel-orange.svg)](https://lawrencemcdaniel.com)A facial recognition microservice built with AWS Rekognition, DynamoDB, S3, IAM, CloudWatch, API Gateway and Lambda. See this [json dump](./doc/json/info_endpoint.json) for configuration options.
## Usage
Index and store a face print:
```console
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:
```console
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](./doc/TERRAFORM.md) first.
Configure Terraform for your AWS account. Set these three values in [terraform.tfvars](./terraform/terraform.tfvars):
```terraform
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:
```terraform
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](https://aws.amazon.com/certificate-manager/) 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)](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing). Backend services run privately, inside an [AWS VPC](https://aws.amazon.com/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](https://aws.amazon.com/cloudwatch/) logs for Lambda as well as API Gateway.
- [AWS serverless](https://aws.amazon.com/serverless/) implementation using [AWS API Gateway](https://aws.amazon.com/api-gateway/), [AWS DynamoDB](https://aws.amazon.com/dynamodb/), and [AWS Lambda](https://aws.amazon.com/lambda/).
- Meta data endpoint [/info](./doc/json/info_endpoint.json) 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](https://www.postman.com/) files for testing.## Requirements
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). _pre-installed on Linux and macOS_
- [make](https://gnuwin32.sourceforge.net/packages/make.htm). _pre-installed on Linux and macOS._
- zip _pre-installed on Linux and macOS_
- [AWS account](https://aws.amazon.com/)
- [AWS Command Line Interface](https://aws.amazon.com/cli/)
- [Terraform](https://www.terraform.io/).
_If you're new to Terraform then see [Getting Started With AWS and Terraform](./doc/TERRAFORM.md)_
- [Python 3.11](https://www.python.org/downloads/): for creating virtual environment used for building AWS Lambda Layer, and locally by pre-commit linters and code formatters.
- [NodeJS](https://nodejs.org/en/download): used with NPM for local ReactJS developer environment, and for configuring/testing Semantic Release.## Documentation
Please see this [detailed technical summary](./doc/README.md) of the architecture strategy for this solution.
## Support
To get community support, go to the official [Issues Page](https://github.com/FullStackWithLawrence/aws-rekognition/issues) 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](./doc/Twelve_Factor_Methodology.md). Please see this [Code Management Best Practices](./doc/GOOD_CODING_PRACTICE.md) 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:
- the [Developer Setup Guide](./doc/CONTRIBUTING.md)
- and these [commit comment guidelines](./doc/SEMANTIC_VERSIONING.md) 😬😬😬 for managing CI rules for automated semantic releases.You can also contact [Lawrence McDaniel](https://lawrencemcdaniel.com/contact) directly. :)