Serverless removal of images backgrounds with OpenCV, using an AWS Lambda.
- Click the "Image Background Removal Launch Stack" button:
This will bring you to either the Cloudformation UI or the AWS console if you are not signed in. Sign in, if you are not already. From the Cloudformation UI, click "Next" at the bottom of the screen. Repeat clicking "Next" on the two following pages. You will reach a page with this towards the bottom:
Checkmark the three "I acknowledgement" statements and select "Create Stack." This will start building the CloudFormation stack. It may take several minutes for CloudFormation to finish.
- Navigate to S3. You should see a bucket named "mask-rcnn-demo-xxxxxxxx", where "xxxxxxxx" is the unique stack identifier from CloudFormation. Open this bucket. You will see an "index.html" file. Open this file. This webpage will appear:
If you select the "Object Mask Options", you can control which object classes are used. The "Output Visualization Options" allows you to set a minimum confidence threshold for the OpenCV DNN model.
- Select a photo. Either select one of the stock photos or upload your own image. Select "Detect," if you uploaded an image or changed the image detection options.
- Congratulations! It's that easy.
Any questions or suggestions, just add an "Issues" submission to this repository. Thanks.
Happy Coding!




