Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV with AWS Lambda

I wrote a Lambda function (Python 2.7) that uses OpenCV. I need to import CV2 and I'm having trouble providing the library in my .zip. Has anyone used OpenCV with Lambda? How can I provide the CV2 module.

like image 319
Matt Auerbach Avatar asked Nov 06 '15 19:11

Matt Auerbach


People also ask

Can I run a Python script on AWS Lambda?

You can run Python code in AWS Lambda. Lambda provides runtimes for Python that run your code to process events. Your code runs in an environment that includes the SDK for Python (Boto3), with credentials from an AWS Identity and Access Management (IAM) role that you manage.

Why use AWS Lambda?

AWS Lambda allows you to add custom logic to AWS resources such as Amazon S3 buckets and Amazon DynamoDB tables, so you can easily apply compute to data as it enters or moves through the cloud. It is easy to get started with AWS Lambda.


1 Answers

You must copy the OpenCV inside the zip that you send to AWS Lambda

This method helps to deploy with OpenCV https://github.com/aeddi/aws-lambda-python-opencv/blob/master/build.sh

like image 54
Daniel Lopes Avatar answered Oct 06 '22 02:10

Daniel Lopes