Giter Site home page Giter Site logo

highpoint / aws-lambda-onnx-model Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 238 KB

Run ONNX machine learning models on AWS Lambda

License: MIT License

Python 100.00%
onnx onnxruntime onnx-models aws-lambda aws-s3 lambda-layer machine-learning docker large-files onnx-runtime

aws-lambda-onnx-model's Introduction

aws-lambda-onnx-model

Run LARGE machine learning models on AWS Lambda with ONNX. The ONNX models can be over 1 GBs.

ONNX

This model has two dependencies, the python Pillow and onnxruntime libraries. These need to be added as AWS Lambda Layers. Numpy is included in the onnxruntime.

In order to create the Lambda Layers, do a Docker pull:

docker pull highpoints/aws-lambda-layer-zip-builder:latest  

Then run:

docker run --rm -v $(pwd):/package highpoints/aws-lambda-layer-zip-builder Pillow  
docker run --rm -v $(pwd):/package highpoints/aws-lambda-layer-zip-builder onnxruntime 

This should create:

pillow3.8.5.zip  
onnxruntime3.8.5.zip

Add these as your AWS Lambda Layers. Make sure you include the key "PYTHONPATH" with the value "/opt/" in the AWS Lambda Environmental Variables configuration. The AWS Lambda runtime setting should be Python 3.8, and the IAM Role should include S3 Read and Write privledges.

Example:

Original Image:

dog5

ONNX 10x Super Resolution:

onnxTestImage-6

Happy Coding!

aws-lambda-onnx-model's People

Contributors

highpoint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

maxim-gapchenko

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.