https://github.com/awslabs/aws-ai-solution-kit

Machine Learning APIs for common use cases, include: General OCR (Simplified/Traditional Chinese), Custom OCR, Image Similarity, Object Recognition, Face Detection, Face Comparison, Human Image Segmentation, Human Attribute Recognition, Pornography Detection, Image Super Resolution, Text Similarity, Car License Plate, etc.

https://github.com/awslabs/aws-ai-solution-kit

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.7%) to scientific vocabulary

Keywords

car-license-plate-recognition chinese-ocr deep-learning face-recognition human-segmentation image-similarity machine-learning ocr ocr-recognition optical-character-recognition simplified-chinese super-resolution text-similarity traditional-chinese
Last synced: 5 months ago · JSON representation

Repository

Machine Learning APIs for common use cases, include: General OCR (Simplified/Traditional Chinese), Custom OCR, Image Similarity, Object Recognition, Face Detection, Face Comparison, Human Image Segmentation, Human Attribute Recognition, Pornography Detection, Image Super Resolution, Text Similarity, Car License Plate, etc.

Basic Info
  • Host: GitHub
  • Owner: awslabs
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 81.4 MB
Statistics
  • Stars: 179
  • Watchers: 19
  • Forks: 26
  • Open Issues: 29
  • Releases: 4
Topics
car-license-plate-recognition chinese-ocr deep-learning face-recognition human-segmentation image-similarity machine-learning ocr ocr-recognition optical-character-recognition simplified-chinese super-resolution text-similarity traditional-chinese
Created over 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

English | 简体中文

AI Solution Kit

Common Machine Learning Features Kit

Documentation · Changelog · Feature List

Apache 2.0 License Build badge Build badge


Introduction

This repository contains several pre-trained deep learning models based on AWS Lambda and Amazon SageMaker, for example: general OCR, text similarity, face detection, human image segmentation, image similarity, object recognition, image super resolution (see full list below). By this project, you can download these dockerized modules from Amazon Elastic Container Registry(ECR) and create REST APIs on Amazon API Getaway. Once the project deployed, you can call the REST API to use these features easily.

For more information about the solution, please refer to our website.

Feature List

Optical Character Recognition(OCR)

| Feature Name | Description | |--------------|-------------| |Lite OCR (Simplified Chinese)|Recognize and extract Simplified Chinese, numbers, alphabetical characters and symbols| |Lite OCR (Traditional Chinese)|Recognize and extract Traditional Chinese, numbers, alphabetical characters and symbols| |Advanced OCR (Multilingual)|Recognize and extract Simplified/Traditional Chinese, Vietnamese, Japanese, Korean, English, numbers, alphabetical characters and symbols. Return the information such as text or coordinates| |Custom OCR|Recognize and extract structured text by predefined OCR templates| |Car License Plate|Recognize text on Chinese car license plate|

Facial & Body

| Feature Name | Description | |--------------|-------------| |Face Comparison|Compare two faces of same person and return a confidence score of the similarity| |Face Detection|Detect the face in a image and return coordinate information of the face| |Human Attribute Recognition |Recognize the attributes of the human body in the image| |Human Image Segmentation|Segment human bodies from background and return the alpha channel|

Image Understanding

| Feature Name | Description | |--------------|-------------| |Image Similarity|Compare two images and return similarity score| |Object Recognition|Segment human bodies from background and return the alpha channel| |Pornography Detection|Detect pornographic image in three dimensions (normal, sexy, porn) and return confidence scores|

Computer Vision Production

| Feature Name | Description | |--------------|-------------| |Image Super Resolution|Upscale the resolution and enhance details in the images|

Natural Language Understanding(NLU)

| Feature Name | Description | |--------------|-------------| |Text Similarity|Compare two Chinese words or sentences and return similarity score| |General NLU|Support a variety of Chinese text understanding tasks, such as text classification, sentiment analysis, extraction, and customizable labeling systems|

Quick deployment

This project is an AWS Cloud Development Kit(CDK) project written in Typescript, if you want to use the above deep learning features without building the entire project, you can use the Amazon CloudFormation template to deploy feature APIs quickly, the generated Amazon CloudFormation template is available at: https://aws-gcr-solutions.s3.amazonaws.com/Aws-gcr-ai-solution-kit/v1.4.0/AI-Solution-Kit.template

Below is the quick links to launch the AWS CloudFormation template into your AWS account

Region name | Region code | Launch --- | --- | --- Global regions(switch to above region you want to deploy) | us-east-1(default) | Launch AWS China(Beijing) Region | cn-north-1 | Launch AWS China(Ningxia) Region | cn-northwest-1 | Launch

Once the AWS CloudFormation template is opened in your AWS account, you can choose the deep learning features in the Parameters section, the step-by-step instruction is available at: https://awslabs.github.io/aws-ai-solution-kit/en/deployment/

Build from source

You can also build this project from source.

Prerequisites

  • An AWS account
  • Configure credential of aws cli
  • Install node.js LTS version, such as v14.x
  • Install Docker Engine
  • Install the dependencies of solution via executing command

shell yarn install && npx projen

  • Initialize the CDK toolkit stack into AWS environment(only for deploying via AWS CDK first time)

shell yarn cdk-init

Deploy project

You can clone this repository to create a local copy on your computer and build this project in root directory by yarn.

  • [Optional] Build docker images by yarn and push to an Amazon ECR repository

shell yarn build-containers

You can push images to an Amazon ECR repository, the step-by-step instructions is available at: https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-ecr-image.html

Once the docker images pushed to Amazon ECR repository, please replace the ecr registry in .projenrc.js file in project root directory. context: { ecrRegistry: 'your-ECR-registry', }

  • Build CDK project

shell yarn build

  • Deploy CDK project

Note If you do not build docker images, the ECR registry for pre-trained images will use default 'public.ecr.aws/aws-gcr-solutions/aws-gcr-ai-solution-kit'

Once the project built, you can deploy to your AWS account.

shell yarn deploy

Once the project deployed, please log in to your AWS console, choose to active deep learning features by updating the Amazon CloudFormation stack. The step-by-step instructions is available at: https://awslabs.github.io/aws-ai-solution-kit/en/deploy-add-delete-api/

Architecture

This project contains two types of implementation: Building on AWS Lambda and building on Amazon SageMaker.

Note The Amazon SageMaker type implementation is only available for image super-resolution feature.

  • Building on AWS Lambda

Architecture

  1. Sending API requests to Amazon API Gateway. The request payload needs to contain the processed image or text.

  2. Amazon API Gateway sends received user requests directly to AWS Lambda functions.

  3. The AWS Lambda function returns the result(JSON format) to the caller.

  • Building on Amazon SageMaker

Architecture

  1. Sending an API request to Amazon API Gateway. The request payload needs to contain the processed image or text.

  2. Amazon API Gateway sends the request to the AWS Lambda function.

  3. AWS Lambda invokes Amazon SageMaker Endpoint, executes the inference in Amazon SageMaker and returns results (JSON format).

API Reference

See API Reference

Authorization and Security

By default, the AI Gateway will enable the IAM authorization and Enable the CloudWatch Logs for accessing and debugging.

License

This project is licensed under the Apache-2.0 License.

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

GitHub Events

Total
  • Watch event: 21
  • Delete event: 19
  • Push event: 19
  • Pull request event: 30
  • Fork event: 5
  • Create event: 1
Last Year
  • Watch event: 21
  • Delete event: 19
  • Push event: 19
  • Pull request event: 30
  • Fork event: 5
  • Create event: 1

Issues and Pull Requests

Last synced: almost 2 years ago

All Time
  • Total issues: 7
  • Total pull requests: 93
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 3 months
  • Total issue authors: 7
  • Total pull request authors: 8
  • Average comments per issue: 2.86
  • Average comments per pull request: 0.04
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 84
Past Year
  • Issues: 5
  • Pull requests: 74
  • Average time to close issues: 9 days
  • Average time to close pull requests: about 2 months
  • Issue authors: 5
  • Pull request authors: 5
  • Average comments per issue: 1.4
  • Average comments per pull request: 0.04
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 69
Top Authors
Issue Authors
  • tiancheng-66 (1)
  • ma3252788 (1)
  • igibek (1)
  • antara678 (1)
  • SnakeO (1)
  • wayne116688 (1)
  • gotters (1)
Pull Request Authors
  • dependabot[bot] (133)
  • IcyKallen (2)
  • arunsathiya (2)
  • AoyuQC (1)
  • yike5460 (1)
  • outstandingcandy (1)
  • trivikr (1)
  • yanbasic (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (133) python (101) javascript (26) go (6)

Dependencies

.github/workflows/build-container.yml actions
  • actions/checkout v2 composite
  • actions/download-artifact v2 composite
  • actions/setup-node v2.2.0 composite
.github/workflows/build-template.yml actions
  • actions/checkout v2 composite
  • actions/download-artifact v2 composite
  • actions/setup-node v2.2.0 composite
.github/workflows/gh-pages.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • peaceiris/actions-gh-pages v3 composite
.github/workflows/pull-request-lint.yml actions
  • amannn/action-semantic-pull-request v4.5.0 composite
.github/workflows/upgrade.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-node v2.2.0 composite
  • actions/upload-artifact v2 composite
  • peter-evans/create-pull-request v3 composite
src/lib/cdk-ecr-deployment/lambda/Dockerfile docker
  • public.ecr.aws/sam/build-go1.x latest build
src/lib/cdk-ecr-deployment/lambda/go.mod go
  • github.com/aws/aws-lambda-go v1.23.0
  • github.com/aws/aws-sdk-go-v2 v1.3.2
  • github.com/aws/aws-sdk-go-v2/config v1.1.6
  • github.com/aws/aws-sdk-go-v2/service/ecr v1.2.2
  • github.com/aws/aws-sdk-go-v2/service/s3 v1.5.0
  • github.com/containerd/containerd v1.5.8
  • github.com/containers/image/v5 v5.17.0
  • github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
  • github.com/opencontainers/go-digest v1.0.0
  • github.com/opencontainers/image-spec v1.0.2-0.20211123152302-43a7dee1ec31
  • github.com/pkg/errors v0.9.1
  • github.com/sirupsen/logrus v1.8.1
  • github.com/stretchr/testify v1.7.0
src/lib/cdk-ecr-deployment/lambda/go.sum go
  • 1014 dependencies
applications/ai-photo-booth/package-lock.json npm
  • 374 dependencies
applications/ai-photo-booth/package.json npm
  • @types/jest ^27.5.2 development
  • @types/node ^10.17.27 development
  • @types/prettier 2.6.0 development
  • aws-cdk 2.31.2 development
  • jest ^27.5.1 development
  • react-scripts 4.0.3 development
  • ts-jest ^27.1.4 development
  • ts-node ^10.8.1 development
  • typescript ~3.9.7 development
  • aws-cdk-lib 2.31.2
  • constructs ^10.0.0
  • react-scripts 4.0.3
  • source-map-support ^0.5.21
applications/ai-photo-booth/reactStaticWebsite/package.json npm
  • @cloudscape-design/components ^3.0.15
  • @cloudscape-design/global-styles ^1.0.1
  • @testing-library/jest-dom ^5.16.4
  • @testing-library/react ^13.3.0
  • @testing-library/user-event ^13.5.0
  • @types/jest ^27.5.2
  • @types/node ^16.11.44
  • @types/react ^18.0.15
  • @types/react-dom ^18.0.6
  • react ^18.2.0
  • react-dom ^18.2.0
  • react-scripts ^5.0.1
  • react-webcam ^7.0.1
  • typescript ^4.7.4
  • web-vitals ^2.1.4
applications/search-for-images-by-image/cdk/package-lock.json npm
  • 376 dependencies
applications/search-for-images-by-image/cdk/package.json npm
  • @types/jest ^27.5.2 development
  • @types/node 10.17.27 development
  • @types/prettier 2.6.0 development
  • aws-cdk ^2.38.1 development
  • jest ^27.5.1 development
  • ts-jest ^27.1.4 development
  • ts-node ^10.8.1 development
  • typescript ~3.9.7 development
  • aws-cdk-lib 2.31.1
  • cdk-bootstrapless-synthesizer ^2.1.1
  • constructs ^10.0.0
  • source-map-support ^0.5.21
package.json npm
  • @types/jest ^28.1.1 development
  • @types/node ^10 development
  • @typescript-eslint/eslint-plugin ^5 development
  • @typescript-eslint/parser ^5 development
  • aws-cdk ^2.55.1 development
  • esbuild ^0.14.43 development
  • eslint ^8 development
  • eslint-import-resolver-node ^0.3.6 development
  • eslint-import-resolver-typescript ^2.7.1 development
  • eslint-plugin-import ^2.26.0 development
  • jest ^27 development
  • jest-junit ^13 development
  • json-schema ^0.4.0 development
  • npm-check-updates ^12 development
  • projen ^0.58.7 development
  • ts-jest ^27 development
  • ts-node ^10.8.1 development
  • typescript ^4.7.3 development
  • aws-cdk-lib ^2.55.1
  • aws-sdk ^2.1001.0
  • cdk-bootstrapless-synthesizer ^2.1.1
  • constructs ^10.0.5
  • deasync ^0.1.26
  • express ^4.17.3
  • serverless-http ^2.6.1
  • source-map-support ^0.5.21
  • swagger-ui-express ^4.3.0
  • yamljs ^0.3.0
yarn.lock npm
  • 784 dependencies
applications/search-for-images-by-image/python/requirements.txt pypi
  • Pillow *
  • elasticsearch ==7.13.4
  • fastapi *
  • mangum *
  • requests *
  • requests-aws4auth *
  • uvicorn *
src/containers/custom-ocr/model/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.5.62
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/custom-ocr/model-blank/requirements.txt pypi
  • Pillow ==9.3.0
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy ==1.22.0
  • onnxruntime ==1.8.1
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/custom-ocr/model-sm/requirements.txt pypi
  • Pillow ==9.3.0
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • flask *
  • gevent *
  • idna ==2.10
  • numpy ==1.22.0
  • onnxruntime ==1.8.1
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/face-comparison/model/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • Shapely ==1.7.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • scikit-image *
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/face-detection/model/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • Shapely ==1.7.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • scikit-image *
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/general-ocr/model-advanced/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/general-ocr/model-standard/requirements.txt pypi
  • GPUtil *
  • Pillow ==8.4.0
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/general-ocr/model-standard-sm/requirements.txt pypi
  • Pillow ==9.3.0
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • flask *
  • gevent *
  • idna ==2.10
  • numpy ==1.22.0
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/general-ocr-traditional/model-standard/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/general-ocr-viet/model-standard/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/green-screen-matting/model/requirements.txt pypi
  • Pillow *
  • boto3 *
  • flask *
  • gevent *
  • numpy ==1.23.5
  • onnxruntime-gpu *
src/containers/human-attribute/model/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • Shapely ==1.7.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/human-image-segmentation/model/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • boto3 *
  • numpy <=1.23.5
  • onnxruntime *
src/containers/image-similarity/model/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • boto3 *
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
src/containers/image-super-resolution/model/requirements.txt pypi
  • GPUtil *
  • Pillow ==8.4.0
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/license-plate/model/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • Shapely ==1.7.1
  • base64image ==0.5.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/object-recognition/model/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • Shapely ==1.7.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • idna ==2.10
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/object-recognition/model-sm/requirements.txt pypi
  • Pillow ==9.3.0
  • Shapely ==1.7.1
  • boto3 *
  • certifi ==2022.12.7
  • chardet ==4.0.0
  • flask *
  • gevent *
  • idna ==2.10
  • numpy ==1.22.0
  • onnxruntime ==1.8.1
  • opencv-python-headless ==4.5.3.56
  • pyclipper ==1.3.0
  • python-dateutil ==2.8.2
  • requests ==2.25.1
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/pornography-detection/model/requirements.txt pypi
  • GPUtil *
  • Pillow *
  • base64image ==0.5.1
  • boto3 *
  • numpy <=1.23.5
  • onnxruntime *
  • opencv-python-headless ==4.5.3.56
  • python-dateutil ==2.8.2
  • six ==1.16.0
  • urllib3 ==1.26.6
src/containers/text-similarity/model/requirements.txt pypi
  • GPUtil *
  • numpy <=1.23.5
  • onnxruntime *
  • transformers *
src/lib/api_resource/requirements.txt pypi
  • requests ==2.25.1