Lookout, an AWS Rekognition Enabled Smart Camera
Lookout is a smart camera project based on a Raspberry Pi (with camera module), AWS IoT and AWS Rekognition.
Lookout’s mission is to watch for vehicles and people and provide near real-time notification. Lookout also performs facial recognition using AWS Rekognition and can tell you exactly who it sees.
Lookout is effective indoors or outdoors - I use mine in a waterproof enclosure above the driveway. Detected motion events are published to an AWS IoT MQTT topic - any IoT device can receive those messages and act on them. This series demonstrates a “notifier” IoT device using AWS Polly to generate voice announcements that are played through a speaker connected to the Raspberry Pi.
Lookout Github Repo
Lookout GitHub repo - https://github.com/2412labs/lookout.git. The repo contains the following items:
- Cloudformation stack
- lambda/ - Python source code for lambdas installed by Cloudformation
- device/ - Python source code for Raspi camera and notifier devices
Lookout Posts
- this post » Lookout, an AWS Rekognition Enabled Smart Camera
- Lookout Part 2 - Configure the AWS stack with CloudFormation
- Lookout Part 3 - Testing the Lookout Application Stack
- Lookout Part 4 - Configure the Raspberry Pi Camera
- Lookout Part 5 - Configure the Raspberry Pi Notifier
Solution Overview
The vastly oversimplified workflow looks like this:
The IoT camera (a Raspi) sends images and mqtt data to the AWS Lookout application. Lookout utilizes Rekognition, Lambda functions and DynamoDB to analyze motion events and data. Detected events are published to an MQTT topic.
Solution Design Details
Let’s break the workflow down a bit further:
- The Raspi (an AWS IoT “thing”) continuously monitors the camera stream for motion using a Python script
- When the Python script detects “potential motion events”:
- Moving objects are cropped out of the image and put in an S3 bucket
- MQTT messages with motion event details are published to an IoT topic
- An MQTT rule triggers a Lambda function with the event payload
- The Lambda uses Rekognition to detect labels, updates the event state in DynamoDB, and publishes new MQTT messages with detected people and objects (if the images contained vehicles or people)
- IoT devices receive event notifications and can choose to execute any appropriate action
- This solution has an example “notifier” device that uses AWS Polly to play voice announcements from events
- An Alexa skill provides event information from the DynamoDB table - for example you can ask Alexa “what has lookout seen today”
Next: Lookout Part 2 - Configure the AWS stack with CloudFormation