This sample code repo will demonstrate how we can use a ready model found on Tensorflow Hub as a bring your own container to Amazon SageMaker, and use it as an endpoint for inference.
The model selected for this demonstration is an object detection model trained on Open Images V4 with ImageNet pre-trained Inception Resnet V2 as image feature extractor that can be found here
The repository contains a notebook that will explain each step in the build and deploy process.
This notebook was tested on Amazon SageMaker Notebook Instance ml.t3.medium
with python3
environment with access to S3, ECR, Amazon SageMaker, and docker installed.
Notice: This sample code uses AWS Resources such as SageMaker Notebook Instance to run the notebook and
Amazon SageMaker endpoint with ml.g4dn.xlarge
for inference,
please make sure to clean up to avoid additional costs when finishing reviewing this sample.
This project designed to run inference on images that were uploaded to S3. A possible architecture diagram that can use this:
- A client upload an image to S3 and sends a POST request to API Gateway
- API Gateway proxies the request to a lambda
- Lambda sends an inference request to Amazon SageMaker
- SageMaker returns the inference results to lambda
- Lambda creates a new image according to the inference results and stores it in S3
- Lambda returns a CloudFront URL back to the client to download the inference image
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.