Raspberry Pi Facial Recognition

So you want to control entry to your secret lair, huh? This project will allow you to use facial recognition using a Pi and AWS.

Raspberry Pi Facial Recognition using AWS Rekognition and Pi-Timolo

Description

Pi-detector is used with Pi-Timolo to search motion generated images for face matches by leveraging AWS Rekognition. In its current state, matches are wrote to event.log. With some additional creativity and work, you could send out a notification or allow/deny access to a room with minimal changes. The install script will place the appropriate files in /etc/rc.loal to start on boot.

Build Requirements

  • Raspberry Pi (Tested with Rpi 3)
  • Picamera
  • AWS Rekognition Access (Free tier options available)

As an alternative, this set of scripts can be modified to watch any directory that contains images. For example, if you collect still images from another camera and save them to disk, you can alter the image path to run facial recognition against any new photo that is created.

AWS Rekognition

Before installing, it is best to get up and running on AWS. For my project, I am using the AWS Free Tier service. Using this allows you 5000 API calls per month, which is good enough for this project. Login to your console and create a new IAM user that has Administrative rights to Rekognition.

View of the user's groups.

If you need help with this step, here is the reference. The thing you need to do is copy down your aws_access_key_id and aws_access_key_secret. To obtain this information, click on the ‘security credentials' tab (from the IAM users page as seen in the images above). If this is your first time, you may have to generate a new secret. You will be asked this information once you start the install script.

Once your user has access to Rekognition, make sure you set your region to US-East because it is one of the few that offer Rekognition services. To change regions, go to EC2, Rekognition, or any other service and look in the upper right hand corner.

Install

Setup a Raspberry Pi with Raspbian Jessie

SSH into your Raspberry pi (or connect it to a monitor and login using pi as the username and raspberry as the password). Don't forget to change the below IP address to your pi's IP. If you need help finding it on the network use nmap (nmap -sn 192.168.1.0/24)

Clone this repo and install:

git clone https://github.com/af001/pi-detector.git 
cd pi-detector/scripts 
sudo chmod +x install.sh 
sudo ./install.sh 

During the install, you will be prompted for your aws credentials that you set up earlier. When asked, enter your AWS Secret Key ID, AWS Secret Access Key, and set the region to us-east-1 (adjust to match the region you chose when you set up AWS Rekognition earlier). An example output would look something similar to the image below:

Source: Raspberry Pi Facial Recognition


About The Author

Muhammad Bilal

I am highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top