An open API service indexing awesome lists of open source software.

https://github.com/t04glovern/aws-opencv-serverless

Run OpenCV 4.0 on Lambda using Serverless framework
https://github.com/t04glovern/aws-opencv-serverless

aws-lambda aws-s3 opencv-python opencv4 serverless serverless-framework

Last synced: about 1 year ago
JSON representation

Run OpenCV 4.0 on Lambda using Serverless framework

Awesome Lists containing this project

README

          

# OpenCV on Lambda

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

## Serverless Setup

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

### Requirements

```bash
serverless plugin install -n serverless-python-requirements
```

Create a `requirements.txt` file with the following

```bash
opencv-python==4.1.0.25
numpy==1.16.3
```

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

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

### Deploy

```bash
serverless deploy
```

### Test

```bash
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
```