Skip to content

t04glovern/aws-opencv-serverless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OpenCV on Lambda

Run OpenCV 4.0 on Lambda using Serverless framework. Extract images from scanned documents

Serverless Setup

## Project Setup
mkdir opencv-serverless
cd opencv-serverless
serverless create --template aws-python3 --name opencv-serverless

Requirements

serverless plugin install -n serverless-python-requirements

Create a requirements.txt file with the following

opencv-python==4.1.0.25
numpy==1.16.3

Also add the following to the custom area in the serverless.yaml template.

custom:
    pythonRequirements:
        dockerizePip: non-linux
        noDeploy: []

Deploy

serverless deploy

Test

aws s3 cp in/square-test.png s3://devopstar-opencv-processing-bucket/square-test.png
aws s3 cp s3://devopstar-opencv-output-bucket/square-test.png out/square-test.png