Computer Vision on edge using OpenCV and on cloud using AWS Rekognition
Computer Vision on edge using OpenCV and on cloud using AWS Rekognition
Here is the code for image recognition using OpenCV and AWS Rekognition service with input from webcam. OpenCV tracks faces and monitors for smiles, when a smile is detected a picture is saved locally on the computer, sent the image to AWS S3 bucket, then AWS Rekognition Service is invoked to analyze that picture, and the results are sent back to console. We need a webcam to provide video input to the program.
$ pip install boto3
, https://github.com/boto/boto3$ aws configure
, https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.htmlUbuntu 16.04 actually ships out-of-the-box with both Python 2.7 and Python 3.5 installed. The actual versions are:
Make sure to create virtual environment for Python 2 while installing OpenCV. Virtualenv is a tool to create isolated Python environments. Refer: http://pythonopencv.com/install-opencv-3-3-and-python2-7-3-5-bindings-on-ubuntu-16-04/, https://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/
If you face isssues while installing OpenCV or running the program, try re-installing OpenCV ‘WITH_JPEG=OFF’ in CMAKE command this time.
Run following code in the terminal,
python cv-opencv-rekognition.py
Enjoy, Have Fun!